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?
I also tried to use something like what follows, but it's not working.
<?php if(condition) { ?> <script> stuff here </script> <?php } ?>
I'm sorry for the formatting, I have no idea why the less-then sign is making the entire line disappear.