note 55920 added to function.eval
| From: | zcox522 at gmail dot com | Date: | Wed, 17 Aug 2005 19:03:21 +0000 |
| Subject: | note 55920 added to function.eval | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-93805@lists.php.net to get a copy of this message | ||
If you send headers after you call the eval() function, you may get this error:
PHP Error: (2) Cannot modify header information - headers already sent by (output started at
something...)
In this case, surround your call to eval() with calls to some ob functions:
<?php
$eval = "some code you want to execute";
ob_start();
eval($eval);
ob_end_clean();
?>
----
Manual Page -- http://www.php.net/manual/en/function.eval.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+55920
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+55920&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+55920&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+55920&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+55920&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+55920&report=yes&reason=non-english
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+55920&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+55920&report=yes
Search -- http://master.php.net/manage/user-notes.php