Microsoft Word - Core PHP Programming Using PHP to Build Dynamic Web Sites

(singke) #1

The while loop in Listing 3.5 tests that the date stored in currentDate is not a Friday. If
it is, then the loop will be finished, and execution will continue after the closing curly
brace. But if the current date is not a Friday, then a list item with the name of the day is
printed and currentDate is advanced 24 hours. At that point, the end of the code block is
reached, so control jumps back to the beginning of the loop.


Listing 3.5 Using while to Print Day Names

Free download pdf