PHP Do While Loop - Code

PHP While Loop Previous Next PHP For Loop


PHP Do While loops through a block of code once,and then repeats the loop as long as a specified condition is true.

Syntax


do{ // Code to be executed } while(condition);

Here is the code of php while loop.

Filename: php / do-while-loop.php


Code
<?php
$i=1;
do{
    $i++;
	echo $i . "
"; while($i<=6); } ?>

Running Step.


Type Url - https://localhost/php/do-while-loop.php


Tags: PHP Do While Loop PHP Code Programming Language


Was this helpful ?

Related Code