How do I find out the number of parameters passed into function?
Posted by Raj
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:
<?php
function test()
{
$number_of_args = func_num_args();
echo "Number of arguments: $number_of_args";
}
test ("a","b");
?>
This entry was posted on October 4, 2009 at 12:14 pm, and is filed under
OOP interview questions and answers,
PHP,
PHP interview questions and answers,
PHP: func_get_args - Manual,
PHP: func_num_args - Manual,
PHP: Function arguments - Manual,
Quesion
.You can leave a response, or trackback from your own site.