Thursday, July 25, 2013

How do I find out the number of parameters passed into function?

How do I find out the number of parameters passed into function?


func_num_args — Returns the number of arguments passed to the function.


Example:


function test()
{
    $number_of_args = func_num_args();
    echo "Number of arguments: $number_of_args";
}


test ("a","b");
?>