How do you check whether a date in the US format of e.g. 2012-01-01 falls on a weekday or weekend in PHP?
Asked
Active
Viewed 7,407 times
2
-
possible duplicate of [Checking if date is weekend PHP](http://stackoverflow.com/questions/4802335/checking-if-date-is-weekend-php) – JJJ Mar 04 '12 at 09:20
1 Answers
11
$weekday = date("w", strtotime("2012-01-01"));
This will be 0 for Sunday through 6, Saturday.

Jordan
- 31,971
- 6
- 56
- 67