Loops

Loops in PHP will do a selected code over and over until told to stop.

For Loops

A for loop will do something X amount of times
for($i=1;$i==100;$i++) { CODE TO EXECUTE } First we set $i equal to 1. Then we say we want the loop to run until $i is equal to 100. Then we tell the loop to increase $i by one.

While Loop

A while loop will do something while a condition is true, its like an if statement that repeats as long as its condition is still true.
while($v == $v2) { CODE TO EXECUTE } This code will run over and over as long as $v is equal to $v2.

Go to sessions >>