Monday, October 3, 2011

How to find number of arguments passed in a function in php?

func_num_args — Returns the number of arguments passed to the function

example:
                                                        function foo()
                            {
                                              $numargs = func_num_args();
                                              echo "Number of arguments: $numargs\n";
                            }

                            foo(1, 2, 3); 
                            ?>

No comments:

Post a Comment