para bucle php
<?php
$fruits = ["apple", "banana", "orange"];
for($i=0;$i<count($fruits);$i++){
echo "Index of ".$i."= ".$fruits[$i]."<br>";
}
?>
SISO
<?php
$fruits = ["apple", "banana", "orange"];
for($i=0;$i<count($fruits);$i++){
echo "Index of ".$i."= ".$fruits[$i]."<br>";
}
?>
/*
For loop in php
*/
<?php
for ($i = 0; $i < 10; $i++) {
echo $i."<br>";
}
?>
<?php
$a = 0;
while($a<=5){
echo $a."<br>";
$a++;
}
?>
for($i = 0; $i <=10; $i++){
echo "The index is $i";
}
<?php
$i = 0;
do {
echo $i;
} while ($i > 0);
?>
<?php
$x = 1;
do {
echo "The number is: $x <br>";
$x++;
} while ($x <= 5);
?>