Google News
logo
PHP - Interview Questions
How to get no of arguments passed to a PHP Function?
func_get_args() function is used to get number of arguments passed in a PHP function.
 
Example :
function foo() {
   return  func_get_args();
}
echo foo(1,5,7,3);//output 4;
echo foo(a,b);//output 2;
echo foo();//output 0;
Advertisement