PHP Questions Home

Categories

Arrays
Files
Forms
Functions
Images
MySQL
Numbers
Others
Strings
Website


PHP Functions

PHP Functions


More PHP

Top Questions
Ask a Question

What is the difference between the while and do while loops?


The difference is that the while loop may never run, depending on it's configuration, whereas the do loop is always executed at least once, because the conditional is only evaluated once the 'do' part has run, rather than before as with the while loop.

Most people use while the majority of the time and never encounter the need for the do...while but it is useful to know about and in some circumstances you will occasionally find it useful to use.

More other PHP Questions

What is a constant in PHP?
How do I add comments to my PHP script?
Can PHP create PDF files for me?
Can I include Javascript in my PHP code?
How do I find out about my PHP installation?