write javascript to page based on a condition
<p>I need to remove some Javascript code based on a server side condition (PHP). What I currently have is a variable holding the Javascript code as text and based on the condition I either echo it or not. However, it's cumbersome to maintain. How do I go about doing it?</p>

<p>I also tried to use something like what follows, but it's not working.</p>

<pre><code>&lt;?php if(condition) { ?&gt; &lt;script&gt; stuff here &lt;/script&gt; &lt;?php } ?&gt;
</code></pre>

<p>I'm sorry for the formatting, I have no idea why the less-then sign is making the entire line disappear.</p>
