If you have PHP >= 5.1:
function isWeekend($date) {
return (date('N', strtotime($date)) >= 6);
}
otherwise:
function isWeekend($date) {
$weekDay = date('w', strtotime($date));
return ($weekDay == 0 || $weekDay == 6);
}
More Related Contents:
- Week of the day for current date in php [closed]
- Convert a date format in PHP [duplicate]
- Correctly determine if date string is a valid date in that format
- How to check if a date is in a given range?
- PHP get number of week for month
- Getting date format m-d-Y H:i:s.u from milliseconds
- Adding one day to a date
- The first day of the current month in php using date_modify as DateTime object
- Calculate age based on date of birth
- php date validation
- PHP get start and end date of a week by weeknumber
- Get week number in month from date in PHP?
- How to get previous month and year relative to today, using strtotime and date?
- How to get closest date compared to an array of dates in PHP
- how to find number of mondays or tuesdays between two dates?
- PHP date format converting
- How to convert ISO8601 to Date format in php
- How to calculate time difference in PHP? [duplicate]
- How do I find the hour difference between two dates in PHP?
- Date function output in a local language [duplicate]
- PHP date – get name of the months in local language
- Get most recent date from an array of dates in “Y-m-d H:i:s” format
- How do you explain the result for a new \DateTime(‘0000-00-00 00:00:00’)?
- Increase days to php current Date()
- Convert to date format dd/mm/yyyy
- PHP: add seconds to a date
- PHP strtotime +1 month adding an extra month [duplicate]
- day of the week to day number (Monday = 1, Tuesday = 2)
- php weeks between 2 dates
- PHP: Date larger than current date