There is a certain difference between the PHP do While loop statement and the while, and the difference is that the do is executed first, regardless of whether the condition is true, while the while must be true.
A "dol while" loop is a while loop that modifies the version slightly. If you recal from a previous experience although the cyclic conditional statement is checked back in real code then executes in the while loop. If a conditional declaration is false the code is then not executed within the loop.
On the other hand, doing so, the while loop always executes its code block at least once. This is because conditional declarations are not checked before the code is loaded and is executed.
PHP's-while and not-looping comparisons, while
A simple example of the difference between the two loop types is a conditional declaration that is always false. First, the While loop
$cookies = 0;
while ($cookies > 1) {
echo "Mmmmm ... I Love cookies! *munch Munch munch* ";
}
No output.
Let me take a look at the doing while statement.
$cookies = 0;
do {
echo "Mmmmm ... I Love cookies! *munch Munch munch* ";
while ($cookies > 1);
The output is.
Mmmmm ... I Love cookies! *munch Munch Munch