Jump to content

senglor

New Members
  • Posts

    3
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

senglor's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. 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
  2. I need to increment i by 2, so looking at this i've figured it out. <?php //for_loop.php for ($x=0; $x<=30; $x=($x+2)) { echo "$x"; } ?>
  3. for() loop to print all of the EVEN numbers between 0 and 30, inclusive. <?php for ($i=0;$i<=30; ????? echo $i ?>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.