iteration statement php code example
Example 1: php iterate through a loop
<?php
$scores = [1,2,3];
foreach ($scores as $score) {
echo $score;
}
Example 2: php loop statement
do
{
code to be executed
}
while (condition)
<?php
$scores = [1,2,3];
foreach ($scores as $score) {
echo $score;
}
do
{
code to be executed
}
while (condition)