while and for php code example
Example 1: php for loop
for($i = 0; $i <=10; $i++){
echo "The index is $i";
}
Example 2: do while php
<?php
$i = 0;
do {
echo $i;
} while ($i > 0);
?>
for($i = 0; $i <=10; $i++){
echo "The index is $i";
}
<?php
$i = 0;
do {
echo $i;
} while ($i > 0);
?>