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?
$weekday = date("w", strtotime("2012-01-01"));
This will be 0 for Sunday through 6, Saturday.
http://www.php.net/manual/en/function.strtotime.php
http://php.net/manual/en/function.date.php
2.1m questions
2.1m answers
60 comments
57.0k users