The Do While loop executes the body of the loop before checking for the condition. Unlike the while loop wherein testing the condition is done first and then executes the statement of the body if its false.
PHP Code
<?php
$i=1;
do{
echo $i;
$i++;
}
while($i<10);
?>
Output
Starting point is set in the $i and will stop at 10.
0 comments:
Post a Comment