This article mainly introduces PHP through the string call function, need friends can refer to the following
1. Call_user_func Code is as follows: function A ($b, $c) { echo $b; echo $c;} call_user_func (' A ', "111", "222" ); Call_user_func (' A ', "333", "444"); //Show 222 333 444?> Calling class internal method is strange, incredibly with array, do not know how to consider the developer, of course, save the new, but also full of innovative: Code as follows: Class A { function B ($c) { echo $c; }} call_user_func (Array ("A", "B"), "111"); /Show?> 2. The Call_user_func_array Call_user_func_array functions are very similar to Call_user_func, except that they are passed in a way that gives the parameters a clearer structure: code as follows: function A ($b, $c) { echo $b echo $c;} call_user_func_array (' A ', Array ("111", "222")); //Show the 222?> Call_user_func_array function can also invoke the code of the method inside the class as follows: Class classa{ function BC ($ B, $c) { $BC = $b + $c; echo $bc; } call_user_func_array (Array (' ClassA ', ' BC ') Array ("111", "222")); //Show 333?> CALL_USER_FUNC functions and Call_user_func_array functions support references, which makes them and ordinary function calls more reactiveCan be consistent: code as follows: Function A (& $b) { $b + +;} $c = 0; Call_user_func (' A ', & $c); echo $c//Display 1 Call_user_func_array (' A ', Array (& $c)); echo $c//Show 2