This article mainly introduces the usage of the PHP function func_num_args, and analyzes in detail the usage skills of function parameters returned by the func_num_args function in combination with the instance form, which has some reference value, for more information about how to use the PHP function func_num_args, see the following example. We will share this with you for your reference. The details are as follows:
Function foo () {$ numargs = func_num_args (); // return the echo "Num fo argumets: $ numargs
\ N "; $ arr = func_get_args (); // returns an array to $ arr print_r ($ arr); // outputs all parameters of this array echo ""; for ($ I = 0; $ I <= $ numargs; $ I ++) {echo $ arr [$ I]."
";}} Foo (1, 2, 3, 45, 6 );
The running result is as follows:
Num fo argumets: 5 Array ([0] => 1 [1] => 2 [2] => 3 [3] => 45 [4] => 6) limit 123456
I hope this article will help you with php programming.