Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // Method that checks whether the current day of week is either Saturday or Sunday using Joomla API
- function isWeekend()
- {
- // Comma separated list of days to check. Sunday = 7
- $allowDays = array(6,7);
- // Do not edit below
- return in_array(JFactory::getDate()->format('N'), $allowDays);
- }
- // Call method
- if (isWeekend())
- {
- echo 'Hooray! is weekend!';
- }
- ?>
Add Comment
Please, Sign In to add comment