$date = '2011-03-19';
$time = strtotime($date);
$day = date('l', $time);
switch($day){
case 'Sunday':
print 'is sunday';
break;
case 'Saturday':
print 'is saturday';
break;
default:
print 'qoo';
break;
}
$time = strtotime($date);
$day = date('l', $time);
switch($day){
case 'Sunday':
print 'is sunday';
break;
case 'Saturday':
print 'is saturday';
break;
default:
print 'qoo';
break;
}
reference
http://stackoverflow.com/questions/1485480/php-how-to-get-sunday-and-saturday-given-a-date-input
沒有留言:
發佈留言