all loops in php code example
Example 1: for loop in php
/*
For loop in php
*/
<?php
for ($i = 0; $i < 10; $i++) {
echo $i."<br>";
}
?>
Example 2: php for loop
for($i = 0; $i <=10; $i++){
echo "The index is $i";
}
/*
For loop in php
*/
<?php
for ($i = 0; $i < 10; $i++) {
echo $i."<br>";
}
?>
for($i = 0; $i <=10; $i++){
echo "The index is $i";
}