This site is mobile accessible. Press the "Tap Here" button to use a different font-size.
Smartphone icons created by Freepik - Flaticon
The
loop - Loops through a block of code a specified number of times.The
loop is used when you know in advance how many times the script should run.for (init counter; test counter; increment counter) {
code to be executed for each iteration;
}
The example below displays the numbers from 0 to 10:
<?php for ($x = 0; $x <= 10; $x++) { echo "The number is: $x <br>"; } ?>
This example counts to 100 by tens:
<?php for ($x = 0; $x <= 100; $x+=10) { echo "The number is: $x <br>"; } ?>
Eventually the navigation links, above, will be replaced by these (previous) and (next) buttons below.
Animated PHP icons used in the buttons provided by ICONS8.COM. Smartphone icons created by Freepik - Flaticon
Module 3 quiz