note 9558 added to eval
| From: | kenny at yellowzone dot com | Date: | Fri, 10 Nov 2000 23:29:43 +0000 |
| Subject: | note 9558 added to eval | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-7581@lists.php.net to get a copy of this message | ||
The following tooks me an hour to figure out:
If you have a variable $hdl contains the
name of the function that you want to
execute, and you have the variable $var
contains the values that need to be passed into the function in $hdl, the
way to execute them is:
eval ("$hdl (\$var);");
So, you can have functions's names saved
in a database, and pass in values come from somewhereelse, and dynamically choose the right
functions to process the input data.
http://www.php.net/manual/function.eval.php