Checking a date that falls on a business day or on a weekend?

How do you check if the date is in US format, for example, 2012-01-01 falls on a weekday or on a weekend in PHP?

+2
source share
1 answer
$weekday = date("w", strtotime("2012-01-01"));

It will be 0 on Sunday from 6 to Saturday.

http://www.php.net/manual/en/function.strtotime.php

http://php.net/manual/en/function.date.php

+11
source

All Articles