Here is my code:
$bag3 = 7;
$row = 4;
$nom = 1;
$arr = array("red", "green", "blue", "yellow");
while ($bag3){
while ($nom <= $bag3){
echo $ay." ".$row;
$nom++;
$row++;
}if ($nom == $bag3){
$nom = 1;
}
}
and here's the output:
red 4red 5red 6red 7red 8red 9red 10
I want it to loop through all the array values: red
, green
, blue
, and yellow
.
like this:
red 4red 5red 6red 7red 8red 9red 10green 11green 12green 13green 14green 15green 16green 17blue 18blue 19blue 20blue 21blue 22blue 23blue 24yellow 25yellow 26yellow 27yellow 28yellow 29yellow 30yellow 31
What should I change in my code?