While loop in PHP

while loop

The while loop executes a block of code continuously until the given condition is satisfied.

Syntax :

while( condition )

Example :

<?php

$i = 0;
while($i != 5)
{
    echo $i;
    $i++;
}

?>


Output for the above code : 01234