brijesh
How do I find out the number of parameters passed into function9. ?
1 Answer(s)      5 years and 3 months ago
Posted in : PHP

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

Advertisement
View Answers

November 15, 2010 at 12:03 PM


Hi all,

If you want to find out the number of arguments in a function then use funcnumargs() function. The funcnumargs ? Returns the number of arguments passed to the function.

Example :

<?php
function number()
{
    $num_of_args = func_num_args();
    echo "Number of arguments: $num_of_args\n";
}

number(1, 2, 3, 4, 5, 6);   
?>

Thanks










Related Tutorials/Questions & Answers: