您好,欢迎访问一九零五行业门户网

php日历代码

php日历代码







@date_default_timezone_set('+8');
function week2day($str) {
$days = array('mon', 'tue', 'wed', 'thu', 'fri', 'sat', 'sun');
return array_search($str, $days) + 1;
}
$selecttimestamp = time();
$curmonth = date('n', $selecttimestamp);
$curyear = date('y', $selecttimestamp);
$curday = week2day(date('d', $selecttimestamp));
$todaynum = date('j', $selecttimestamp);
$curmonthtotal = date('t', $selecttimestamp);
$firstday = week2day(date('d', mktime(0,0,0,$curmonth,1,$curyear)));
$lastday = week2day(date('d', mktime(0,0,0,$curmonth,$curmonthtotal,$curyear)));
for($i=0;$iecho('
');
}for($i=1;$iif($i == $todaynum){
echo('
x
');
}else{
echo(''.$i.'
');
}}
?>
其它类似信息

推荐信息