|
|
You can delay the decision to continue executing a loop until the end by using a do...while statement. retools. You won't notice a difference unless you run the script on a Friday. On Fridays the original will print nothing in its list of days. The new version will put Friday in the list because the body of the loop is executed before currentDate is tested. By switching to a do...while loop, the loop now lists the days until next Friday.
Using do...while to Print Day Names
<?
|
|
PHP Related Tutorials |
|
---|---|
MySQL Tutorial | Drupal Tutorial |
WordPress Tutorial | Joomla Tutorial |
CakePHP Tutorial | CodeIgniter Tutorial |
PHP7 Tutorial |
All rights reserved © 2020 Wisdom IT Services India Pvt. Ltd
Wisdomjobs.com is one of the best job search sites in India.