You could just check for the month & day. Something like this:
$now = time();
$holidays = array('0115'=>'MLK Day', '0202'=>'Groundhog Day', '0704'=>'Independence Day', '1225'=>'Christmas');
$today = date('md', $now);
if(array_key_exists($today, $holidays))
{
$status = 'closed for the holiday: ' . $holidays[$today];
}
else
{
$day = date('D', $now); // 'Mon' = 'Sun'
$hour = date('G', $now); // 0 - 23
$status = 'closed';
switch($day)
{
case 'Sun':
break; // closed all day
case 'Sat':
if($hour >= 8 and $hour < 12)
{
$status = 'open';
}
break;
default: // Mon - Fri
if($hour >= 8 and $hour < 17)
{
$status = 'open';
}
}
}
echo "We are currently $status.";
Crap!! While I was coding... Charles was replying....