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 While Loops Tutorial

PHP while loops will execute a block of code if and as long as a specified condition is true.

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

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.