View Full Version : While loops

Tri Edge
11-19-2007, 11:08 PM
I have to put a while loop in an assignment and I was wondering if someone could explain what it does and possibly give me an example then I can at least attempt it on my own, but an explination will be just fine thanks!

11-19-2007, 11:35 PM

11-19-2007, 11:57 PM

Just a very basic example:

$i = 1;
while ($i <= 10) {
echo "This is line $i<br>"; // print line number
$i++; // add 1 to $i


This is line 1
This is line 2
This is line 3
This is line 4
This is line 5
This is line 6
This is line 7
This is line 8
This is line 9
This is line 10