PHP: literal \n rather than new line
<p>I have a php var which, when echoed, writes a JS function into the source of a page. The function loops through a CSV and so it has the following line within it:</p>

<pre><code>$str="var lines = data.split('\n');";
</code></pre>

<p>At the present time, when echoed, I get this 'correct' JS written into the source:</p>

<pre><code>var lines = data.split('
');
</code></pre>

<p>Instead, I want to echo the literal string <code>\n</code> into the source of the page.</p>

<p>Can anyone point me in the right direction? Thanks.</p>
