View Single Post

  #3 (permalink)  
Old 08-26-2007
Robert Keizer
 
Posts: n/a
Default Re: Calling functions which names are inside a variable

Thats great thanks, but it doesn't solve my problem completly, im trying to
use $output = $var(); .. which gives me an error. The $var(); works though,
so thanks for that.

Robert Keizer
""Robert Keizer"" <nuclearsanta@gmail.com> wrote in message
news:op.txnjmzww9011uo@lenovo-b0c37194...
>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

Reply With Quote