views:

2436

answers:

0

I've seen both the blocks of code in use several different times, personally I have always used the first but my question is: is there a functional difference, and if there is what is it?

while (condition is true ) {
    // do something
}

do {
    // do something
} while ( condition is true);

I will be applying this to PHP but I assume this is fairly language agnostic.