Using Each() Function In Conjunction With List()

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

Enjoyed this post? Share it!

 

Leave a comment

Your email address will not be published.