From: "david" <[EMAIL PROTECTED]>
> Cpt John W. Holmes wrote:
> > From: "david" <[EMAIL PROTECTED]>
> >
> >> i found a solution (hopefully) with:
> >>
> >> if(function_exists($function)){
> >> eval('$return = $function($input);');
> >> }else{
> >> // function does not exists
> >> }
> >>
> >> which works quit nicely for now. not sure if that's a good thing to do.
> >
> > Why not just do this:
> >
> > if(function_exists($function))
> > { $return = $function($input); }
> > else
> > { //function does not exist; }
> >
>
> because i didn't know PHP can do that. thanks for the tip! any differences
> between the 2 version in turns of performance and safety?
You're not invoking eval() for one thing and there's less of a security risk
compared to passing variables into an eval() function.
---John Holmes...
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php