/*
function written by nelson neoh @3/2004.
for those who wants to utilize this code, please do not remove this remark.
if you have done any enhancement to this code, please post the copy at http://www.dev-club.com php board. thank you.
function usage: calendar(month,year)
*/
function calendar($mm,$yyyy){
if($mm=="") $mm = date("m");
if($yyyy=="") $yyyy = date("y");
if(checkdate($mm,1,$yyyy)){
$stringdate = strftime("%d %b %y",mktime (0,0,0,$mm,1,$yyyy));
$days = strftime("%d",mktime (0,0,0,$mm+1,0,$yyyy));
$firstday = strftime("%w",mktime (0,0,0,$mm,1,$yyyy));
$lastday = strftime("%w",mktime (0,0,0,$mm,$days,$yyyy));
$printdays = $days;
$premonth = strftime("%m",mktime (0,0,0,$mm-1,1,$yyyy));
$preyear = strftime("%y",mktime (0,0,0,$mm-1,1,$yyyy));
$nextmonth = strftime("%m",mktime (0,0,0,$mm+1,1,$yyyy));
$nextyear = strftime("%y",mktime (0,0,0,$mm+1,1,$yyyy));
print("
| P | ");".strftime("%b %Y",mktime (0,0,0,$MM,1,$YYYY))." | ");N | ||||
|---|---|---|---|---|---|---|
| Sun | Mon | Tue | Wed | Thu | Fri | Sat |
| $printDays | ");"); | $currentDays | ");"); | $currentDays | ");$currentDays | ");
");
}
}
?>
php免费学习视频:立即使用
踏上前端学习之旅,开启通往精通之路!从前端基础到项目实战,循序渐进,一步一个脚印,迈向巅峰!










