The do...while statement always execute the block of code once, then check the condition, and repeat the loop until the condition is true.
code to be executed;
Here we define i = 1, and then increment i with 1. The code first execute i=1+1, print 2; then it checks the further condition. The loop continues until i reaches to either 5 or less than 5.
echo “The number is “ . $i . “<br />”;
The number is 2
The number is 3
The number is 4
The number is 5
The number is 6
Posted on: July 10, 2009 If you enjoyed this post then why not add us on Google+? Add us to your Circles