Re: Call function and get return...
| From: | Soeren Staun-Pedersen | Date: | Wed, 16 Aug 2000 08:28:53 +0000 |
| Subject: | Re: Call function and get return... | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-11946@lists.php.net to get a copy of this message | ||
>
> Now I need to get back a return-value from my functions, for example:
> function f2()
> { return 2;
> }
>
> But "eval" doesn't return any results... How is it done ?
make the eval do:
function doIt($func)
{
$returnvalue=0;
eval("$returnvalue = $func;");
return $returnvalue;
}
echo doit("foo()");
etc.
Soeren Staun-Pedersen - staun@netwarriors.org
------
"The internet is full, beat it"
- Me.