call_user_func_array

6th Feb 19
Thumbnail

Use this function to call a method of a class and pass parameters to it.

class Post 

{

       public function save($arg1, $arg2)

       {

       }

}

....

$post = new Post();

call_user_func_array([$post, "save"], [123, "abc"]);

 

I have recently completed my apprenticeship.  I am currently building the API to a React JS site using Firebase.