A "do while" loop is a slightly modified version of the while loop.
In "while-loops" the conditional statement is checked and if true then the code within the while loop is executed.
On the other hand, a "do-while" loop always executes its block of code at least once.
This is because the conditional statement is not checked until after the contained code has been executed.
The examples below shows the difference between these two loop types.
This while loop's conditional statement failed (0 is not greater than 1), therefore the code within the while loop was not executed.
The code segment "buy a book" was executed first.
A do-while loop first do it and and then it checks the while condition!
You might not need to use a do while loop often but it is good to know it's there!
Note For more detail please see Php Manual at http://www.php.net