do...while StatementCode:<html> <body> <?php $i=1; do { $i++; echo "The number is" . $i . "<br/>"; } while($i<=5) ?> </body> </html>
Out Put:
The number is2
The number is3
The number is4
The number is5
The number is6
Starts with i=1. It will then increment i with 1, and write some output. Then the condition is checked, and the loop will continue to run as long as i is less than, or equal to 5:




Reply With Quote
Bookmarks