I've gotten it to output "david" but can't figure out how to get it to 55 and "john". i believe I need an loop here but can't figure it out. Any help or suggestions would be appreciated.
<?php
2 function foo()
3 {
4 $numargs = func_num_args();
5 echo "Number of arguments: $numargs<br />\n";
6 if ($numargs >= 2)
7 {
8 echo "First argument is: " . func_get_arg(0) . "<br />\n";
9 }
10 else
11 {
12 echo "Second argument is: " . func_get_arg(1) . "<br />\n";
13
14 }
15 }
16
17
18 foo ("david", 55, "john");
19 ?>
Output so far:
Number of arguments: 3
First argument is: david