for loop in php w3schools code example
Example 1: php for loop
for($i = 0; $i <=10; $i++){
echo "The index is $i";
}
Example 2: for each php
<?php
foreach (array(1, 2, 3, 4) as &$value) {
$value = $value * 2;
}
?>
for($i = 0; $i <=10; $i++){
echo "The index is $i";
}
<?php
foreach (array(1, 2, 3, 4) as &$value) {
$value = $value * 2;
}
?>