Sample Code:
//================================
<?PHP // version 4.3.6
function testFunction($foo) {
return $foo=="TEST";
}
function wrapper($foofunc, $foovar) {
return eval("return $foofunc($foovar);");
}
echo wrapper("testFunction", "TEST");
?>
//================================
This code works. It calls the function and
receives the appropriate return value.
But, is there a better way of doing this?
It seems a bit round-a-bout.
Thanks!
- Re: [PHP] Dynamic Function with return? bskolb
- Re: [PHP] Dynamic Function with return? Pahlevanzadeh Mohsen
- Re: [PHP] Dynamic Function with return? Jennifer Goodie
- Re: [PHP] Dynamic Function with return? Michal Migurski

