Re: eval();
| From: | John Taylor-Johnston | Date: | Mon, 31 Oct 2005 02:24:58 +0000 |
| Subject: | Re: eval(); | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-224856@lists.php.net to get a copy of this message | ||
<?php
Shouldn't that error because of the unexpected ?> and <?php in a bigger example? John$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.