note 18747 added to function.eval

From: Date: Sun, 03 Feb 2002 23:15:01 +0000
Subject: note 18747 added to function.eval
Groups: php.notes 
Request: Send a blank email to php-notes+get-26182@lists.php.net to get a copy of this message
It seems that the comment stating that you should prepend your string with <?php is wrong. (php4) For some reason one must add ?> before the actually php file content, but adding <?php will result in <?php being added to output sent to browser. eval('?>' . $dbcontent); // will parse the $dbcontent as php file eval('?>' . $dbcontent . '<?php'); /* same as above but ads "<?php" to the output */ also there is no need to use addslashes if you use this method. -- http://www.php.net/manual/en/function.eval.php http://master.php.net/manage/user-notes.php?action=edit+18747 http://master.php.net/manage/user-notes.php?action=delete+18747 http://master.php.net/manage/user-notes.php?action=reject+18747

« previous php.notes (#26182) next »