Re: eval();

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



<?php

$contents = "<div class=\"indent\" style=\"font-size: 16px; font-family: arial,helvetica; font-weight: bold;\">About the Project</div>
<?php echo \"hello world\"; ?>";
echo eval($contents);
?>
eval() expects PHP code, not HTML with embedded PHP code. Try this
(untested):

eval( " ?> $contents <?php " );

Scary. But it works.
Shouldn't that error because of the unexpected ?> and <?php in a bigger example?
John

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux