eval() destroying line breaks
Posted: Tue Aug 25, 2009 5:56 am
Here's a tiny test script that illustrates the problem:
The result is:
How do I get the
result that I expect to get? I can't see why it's eating the line break after the condition.
Code: Select all
<?php
echo eval("?>line 1
<?php if (1) { ?>line 2<?php } ?>
line 3
<?php ");
?>Code: Select all
line 1
line 2line 3Code: Select all
line 1
line 2
line 3result that I expect to get? I can't see why it's eating the line break after the condition.