For Loops in PHP with example

In PHP, for loops execute a block of program a specified number of times, or while a specified condition is true.
Syntax :
for (initial; condition; increment)
{
    Program will execute if condition is true;
}

Print some numbers from 1 to 4 using For loops
<?php
$i = 1;
for($i=0;$i<=4;$i++) {
    echo $i;
}
?>

Output : 1 2 3 4 .