while loop php array code example
Example 1: php while loop array
$foodArray = ["Eggs", "Bacon", "HashBrowns", "Beans", "Bread"];
foreach ($foodArray as $food) {
echo $food ."<br />";
}
Example 2: while loop php
<?php
$a = 0;
while($a<=5){
echo $a."<br>";
$a++;
}
?>