Do While Loops in PHP

In PHP, the function of a do-while loop is to do a task, over and over as long as the specified conditional statement is true. . But do-while loop always executes its block of code at least once.

Syntax :
do
{
    Program will execute if condition is true or at first time;
}
while (condition);

Print some numbers from 2 to 5 using do-while. but current value of $i is 1
<?php
$i = 1;
do {
    $i++
    echo $i;
}
while($i<=4)
?>

Output : 2 3 4 5

Program executing one time using do-while.
<?php
$i = 0;
do {
    echo $i;
}
while($i>1)
?>

Output : 0