Calling functions which names are inside a variable
| From: | Robert Keizer | Date: | Sun, 26 Aug 2007 05:46:01 +0000 |
| Subject: | Calling functions which names are inside a variable | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-261281@lists.php.net to get a copy of this message | ||
I am currently working on a module testing class, I can't seem to find the correct syntax. Here is an example of the problem:
function foo( $var ){
include $var.'.php';
return $var(); // <!------- problem
};
foo("somefunction");
In other words I am looking for a way to call a function by the value of a variable. I get a Call to undefined method error,
any help would be great..
--
nuclearsanta@gmail.com