|
Posted by Hero Wanders on 08/29/05 14:48
Hello!
> I would like to call a static function when I only have the class name
> in a variable and the function name.
>
> What is the correct syntax to do this please?
You can use this:
$class = 'MyClass';
$function = 'aStaticFunc';
call_user_func(array($class, $function), 'a', 'b', 'c');
If you have dynamic parameter lists, use call_user_func_array().
Greetings,
Hero Wanders
[Back to original message]
|