PHP For Loop


PHP For Loop

Examples using the for loop with PHP.

Loop Syntax #1

for($i=1; $i < 5; $i++) {
echo $i."<br/>";
}

Loop Syntax #2

for($myvar=1; $myvar < 5; $myvar++) {
echo $myvar."<br/>";
}