php function to echo javascript string
<p>Is the a proper php function to echo javascript string?<br>
I want to the php function to echo something like this:</p>

<pre><code>&lt;!--/* OpenX Interstitial or Floating DHTML Tag v2.8.7 */--&gt;
&lt;script type="text/javascript"&gt;// &lt;![CDATA[
//&lt;![CDATA[
var ox_u = 'extremely_long_url_string';
if (document.context) ox_u += '&amp;context=' + escape(document.context);
document.write("&lt;scr"+"ipt type='text/javascript' src='" + ox_u + "'&gt;&lt;/scr"+"ipt&gt;");
//
// ]]&gt;&lt;/script&gt;
</code></pre>

<p>I know I can put it all in one line and use \ to escape all the quotes BUT I'm looking for a more elegant &amp; effective solution.</p>
