Please note, this is a STATIC archive of website webdevelopmenttutorials.com from 20 Jul 2022, cach3.com does not collect or store any user information, there is no "phishing" involved.

Tutorials

Learn web design and programming with our free video and text tutorials.

Web Designer? Design and market your own professional website with easy-to-use tools.

PHP for Loops Tutorial

PHP for loops execute a block of code a specified number of times.

<?php
for($a=0; $a<10; $a++) {
echo "This statement was executed $a times.<br />";
}
?>

The code above outputs:

This statement was executed 0 times.
This statement was executed 1 times.
This statement was executed 2 times.
This statement was executed 3 times.
This statement was executed 4 times.
This statement was executed 5 times.
This statement was executed 6 times.
This statement was executed 7 times.
This statement was executed 8 times.
This statement was executed 9 times.