note 46140 added to function.eval
| From: | lamp at dernassi dot com | Date: | Thu, 30 Sep 2004 20:27:12 +0000 |
| Subject: | note 46140 added to function.eval | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-77626@lists.php.net to get a copy of this message | ||
Dernassi:
I discover a lack in the "eval()" function. So I decide to add my contribution.
I create a function that actually returns the value of PHP script, function or exression. Here it
is:
<?php
function evaluer($chaine)
{
$valeur = '$valeur=' . $chaine;
eval("$valeur");
return ($valeur);
}
?>
The main interest is that you hold the value returned by the function and you store it for later
use, in a data base and so on. I hope it is usefull.
===============
By M. Dernassi,
lamp@dernassi.com
http://dernassi.com/
----
Manual Page -- http://www.php.net/manual/en/function.eval.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+46140
Delete -- http://master.php.net/manage/user-notes.php?action=delete+46140&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+46140&report=yes
Search -- http://master.php.net/manage/user-notes.php