Parse call_user_func_array in php. 1. directly call the method to copy the code: functiontest ($ a, $ B) {echo Test 1 :. $. $ B;} calls the test method. array (asp, php) corresponds to the corresponding parameter call_user_func _
1. directly call the method
The code is as follows:
Function test ($ a, $ B)
{
Echo 'test 1: '. $ a. $ B;
}
// Call the test method. array ("asp", 'php') corresponds to the corresponding parameter.
Call_user_func_array ('test', array ("asp", 'php '));
2. call methods in the class through the class
The code is as follows:
Class test2 {
Function phpSay ($ a, $ B)
{
Echo 'test 2: '. $ a. $ B;
}
}
$ O = new test2 ();
// Equivalent to: $ o-> phpSay ('php', '');
Call_user_func_array (array (& $ o, 'phpser'), array ('php', ''));
The response code is as follows: function test ($ a, $ B) {echo 'test 1 :'. $. $ B;} // call the test method. array ("asp", 'php') corresponds to the corresponding parameter call_user_func _...