Here is an example in its simplest form:
<?php
$num = 1;
while ( $num <=10 )
{
print $num . " ";
$num++;
}
?> Basically what this does is: while a number is greater than or equal to 10 it prints the number. The ++ adds one to the number, however this could also be phrased as $num = $num + 1; Once the number becomes greater than 10, in our case it becomes 11, then it stops executing the code within the {brackets}
Below is an example of how you can combine a loop with a conditional
<?php
$num = 1;
while ( $num <=10 )
{
if ($num < 5)
{
print $num . " is less than 5 <br>";
}
else
{
print $num . " is not less than 5 <br>";
}
$num++;
}
?>



