do

Do loops through the statements enclosed within the { code block } until the following while test condition is false:

 

do {

statements ;

statements ;

} while (test expression;

 

*note ending semi-colon ; after the while test expression!

 

<?php

	do {
		echo "\$myVar is currently $myVar<br>" ;

		$myVar++ ;

	} while ($myVar < 5) ;

?>

Leave a Reply