macam " perulanagn menggunakan while

http://php.net/manual/en/control-structures.while.php
http://www.w3schools.com/php/php_looping.asp



one = array("10", "20", "30", "40");
$two = array("a", "b", "c", "d");

$i=0;
while($i < count($one)) {
   reset($two);
   while($a = each($two)) {
       echo $a[1]." - ".$one[$i].", ";
   }
   $i++;
  
}

This produces:

a - 10, b - 10, c - 10, d - 10, a - 20, b - 20, c - 20, d - 20, a - 30, b - 30, c - 30, d - 30, a - 40, b - 40, c - 40, d - 40,

Subscribe to receive free email updates:

0 Response to "macam " perulanagn menggunakan while"

Post a Comment