Using each() function in conjunction with list() : each « Data Structure « PHP






Using each() function in conjunction with list()

 
<?
    $spices = array("A", "B", "C", "D", "E");
    reset ($spices);
    while ( list ($key, $val) = each ($spices) ) :
         print "$val <br>";
    endwhile;
?>
  
  








Related examples in the same category

1.each() function returns the key-value pair at the current pointer position and moves the pointer to the next element.