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
1.4m articles
1.4m replys
5 comments
57.0k users