Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $infArgs = function($args)
- {
- echo "You have supplied " . func_num_args() . " arguments:<br />";
- $actualArgs = func_get_args();
- for($i = 1; $i <= count($actualArgs); $i++)
- {
- echo "Parameter $i: " . $actualArgs[$i - 1] . "<br />";
- }//End for
- echo "...also $args."; //Equal to func_get_args()[0]
- };//End infArgs()
- $infArgs('one', 'two', 'three', 'four'); //Counts 4
- $infArgs('one', 'two', 'three', 'four', 'five', 'six', 'seven'); //Counts 7
- $infArgs(); //Error: not enough params
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement