php loops w3c code example
Example 1: for loop php
<?php
$fruits = ["apple", "banana", "orange"];
for($i=0;$i<count($fruits);$i++){
echo "Index of ".$i."= ".$fruits[$i]."<br>";
}
?>
Example 2: php for loop
for($i = 0; $i <=10; $i++){
echo "The index is $i";
}