while Loops
This lesson introduces the while loops in PHP. It uses coding examples to show their implementation and explains how they work.
We'll cover the following...
What Is the While Loop? #
The while
loop is really the only necessary repetition construct. The for
loop, coming up, can be duplicated using a while
loop, and with more control.
So basically, the while loop consists of a condition and while that condition is true, a set of statements is executed repeatedly. The syntax is as follows: