Posted By:
16 Mar, 2014 2:52 am PDT

do-while loop in PHP

How to use do-while loop in PHP?

do-while loops is almost same as while loop except the truth expression is checked at the end of each iteration instead of in the beginning. do-while loop is executed atleast once as the condition is checked at the end.


//To print the following series using do-while loop.



<!DOCTYPE html>







echo $i;








/*Output of the above program is :



Attachment: doWhile.php

Video tutorial on do-while loop.This illustrate what is do-while loop ,how to use this loop and how it differs from other loops(like while loop etc.).

Was it useful?  

Please login to reply to this problem.