The while Loop
The example below first sets a variable $i to one ($i = 1). Then, the
while loop runs as long as $i is less than seven ($i < 7). $i will increase by one each time the loop runs ($i++):
$i = 1;
while ($i < 7) {
echo "The value is $i <br />";
$i++;
}
This produces the following result:
No comments:
Post a Comment