note 18084 added to function.eval
| From: | php-general at lists dot php dot net | Date: | Thu, 10 Jan 2002 02:13:45 +0000 |
| Subject: | note 18084 added to function.eval | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-24606@lists.php.net to get a copy of this message | ||
The previous comment would imply to me that you must also add '<?php' after $string in
the eval function, so that your original file may continue with additional php code after the eval()
So...
--- file: example.php ---
<?php phpinfo(); ?>
--- file: mypage.php ---
<?php
$string = implode ('', @file('example.php'));
// Massage the contents of $string however you want.
eval ('?>' . $string . '<?php');
// Additional code continues...
$allWorldProblems = "cured";
... etc
?>
--
http://www.php.net/manual/en/function.eval.php
http://master.php.net/manage/user-notes.php?action=edit+18084
http://master.php.net/manage/user-notes.php?action=delete+18084
http://master.php.net/manage/user-notes.php?action=reject+18084