Sunday, January 24, 2016

PHP LOOP: Display Numbers Using Do While Loop

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.

PHP LOOP: Display Numbers Using Do While Loop

PHP LOOP: Display Numbers Using Do While Loop Rating: 4.5 Diposkan Oleh: Emoblazz

0 comments:

Post a Comment