Re: eval();

From: 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
$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

« previous php.general (#224856) next »