How to calculate the number of parameters passed by function by PHP
Editor to share with you PHP how to calculate the number of parameters passed by the function, I believe that most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!
1. You can count the number of parameters passed into the PHP function with the help of the func_num_args () function.
2. The func_num_args () function is used to return the number of parameters passed to the function, and its syntax is "func_num_args (): int".
The return value is: returns the number of parameters passed into the current user-defined function.
This function can be used with func_get_arg () and func_get_args () to allow user-defined functions to accept variable-length argument lists.
Example