[pmwiki-devel] PHP question...

Dominique Faure dominique.faure at gmail.com
Thu Mar 8 05:51:21 CST 2007


On 3/8/07, The Editor <editor at fast.st> wrote:
> I'm wondering if it is possible to store a function in a variable and
> then call that variable somehow without using the eval command.
>
> For example, something equivalent to:
>
> $command = "myFunction";
> $parameter = "some value";
> eval ("$command($parameter)");
>
> function myFunction($x) {
>   ...
>
> I don't want to use eval because of security concerns as the parameter
> will contain user supplied information.  Any suggestions?
>

http://docs.php.net/manual/en/functions.variable-functions.php

will do the trick!
Dom



More information about the pmwiki-devel mailing list