Home >Backend Development >PHP Tutorial >PHP code to call function through string
Learn php to call functions through strings. 1. call_user_func
It is strange to call the method inside the class, actually using array , I don’t know how the developers thought about it. Of course, new is omitted, which is also full of novelty:
2. call_user_func_array The call_user_func_array function is very similar to call_user_func, except that the parameters are passed in a different way to make the structure of the parameters clearer:
The call_user_func_array function can also be called inside the class The method of
Both the call_user_func function and the call_user_func_array function are supported quotes, which makes them more functionally consistent with ordinary function calls:
|