The main difference between a while and do-while loop is that in a do-while loop, the statements in the loop will be executed at least once.

Difference between do-while and while loop

A do-while loop evaluates the expression after each execution of the loop whereas the while loop evaluates the expression before each execution of the loop.

Example

<?php
$i = 0;
do 
{
    echo $i."<br>";
} while ($i > 5);
?>

Output

0

Note: Unlike while loop, there is no alternative-syntax for a do-while-loop.