Re: Call function and get return...
| From: | Juri Smarschevski | Date: | Wed, 16 Aug 2000 08:50:29 +0000 |
| Subject: | Re: Call function and get return... | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-11952@lists.php.net to get a copy of this message | ||
> -----Original Message-----
> From: Martin Thoma [mailto:martin@radiok2r.de]
> Sent: Wednesday, August 16, 2000 10:33 AM
> > make the eval do:
> >
> > function doIt($func)
> > {
> > $returnvalue=0;
> > eval("$returnvalue = $func;");
> > return $returnvalue;
> > }
> >
> Hi and thanx again for your help. But this will give $returnvalue the
> function-name:
>
> DoIt("f2()");
>
> will make $returnvalue = "f2()"; :-(
another one ;-)
function doIt($func)
{
$MyCommand = "\$returnvalue=".$func;
$returnvalue=0;
eval($MyCommand);
return $returnvalue;
}
DoIt("f2();");
^^
Regards,
Juri