View: Call a user function given by the first parameter in PHP

  1. 2 months ago by jemini_fr and saved by 1 other
    1. // Call a class method outside the class
    2. call_user_func(array($myclass, $mymethod), $args);
    3.  
    4. // Call a class method inside the class
    5. call_user_func(array($this, $mymethod), $args);
    6. //or
    7. $this->{$mymethod}($args);

0 comment about "Call a user function given by the first parameter in PHP"