PHP TutorialsPhp What is
PHP INI TutorialsPhp ini What is
The do ... while loop takes an expression such as a while statement but places it at the end. do ... while loop is useful when you want to execute a block of code at least once regardless of the expression value.
The above code in the loop displays 11 because the loop always executes at least once. Following the pass, while evaluates to FALSE, causing execution to drop out of the do ... while loop.
The only difference between a do... while loop and a while loop is that the code within the do block is executed at least once, even if the condition is never true.