php do while loop

The final loop type we describe behaves slightly differently. The general structure of a do…while statement is

do
expression;
while( condition );

A do…while loop differs from a while loop because the condition is tested at the end. This means that in a do…while loop, the statement or block within the loop is always executed at least once

$num = 100;
do{
 echo $num."<br />";
}while ($num < 1 ) ;

Leave a Comment