note 46140 deleted from function.eval by nlopess
| From: | nlopess@php.net | Date: | Sat, 13 Nov 2004 17:08:05 +0000 |
| Subject: | note 46140 deleted from function.eval by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-80464@lists.php.net to get a copy of this message | ||
Note Submitter: lamp at dernassi dot com
----
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/