PHP » Control Structures » do ... while

Syntax:
do {
   // block to repeat
} while (condition);

Repeats a block code as long as a condition is met.

This loop statement is very similar to while, but the test comes after the block of code, which means that the code will be executed at least once.

Examples

Code:
<?php

$fruits = array("apple", "banana", "orange");

do {
   print current($fruits) . " ";
} while (next($fruits));

?>
Output:
apple banana orange
Explanation:

This code does shows how the same result as in the while example is accomplished with do.

See Also: