In this article, you will learn how to create a for loop in PHP. The for keyword in PHP is used to create a for loop, which loops through a block of code a specified number of times.
examples of the FOR keyword
Example 1. In this example, we print even numbers less than 10.
<?php
for($i = 0; $i < 10; $i += 2) {
echo "$i <br>";
}
?>