PHP Do…While

PHP Do…While

Do…While syntax

do{
execute statement
}while (expression is true) ;

Do…While example

<html>
<body>
<?php
	$n = 1;
	do{
		echo "<br />";
		echo "n = ", $n++;
	} while ($n <= 3) ;
?>
</body>
</html>

Result

n = 1
n = 2
n = 3