Need a Website Or Web Application Or Any Help In Code , Contact Us: +91 9437911966 (Whatsapp), Note: Paid Service
Students Tutorial app relased. Download Now.

PHP do-while loops

The do...while loop will always execute the block of code once In PHP do..while loop is similar to while loop but one key difference between them.The do...while loop will always execute the block of code once. If the the condition is true then code of block executed repeatedly, until the condition becomes false.

But in while loops execute a block of code while the specified condition is true.

Syntax

do {
    code to be executed;
} while (condition is true);
<?php
$a=1;
do
{
echo $a;
$a++;
}
while($a<=10)
?>

Run It Yourself ยป