PHP生成カレンダーコード
3525 ワード
/* Function Written by Nelson Neoh @3/2004. For those who wants ト utilize this コード、 please ド not remove this remark. If。 あなた すばらしい done any enhancment ト this コード、 please ベスト the copy at。 http://www.dev-club.com PHP board. Thank あなた.Function usage: careendar(Month,Year)*/function careendar($MM、$YYY){ if($MM==") $MM = ダテ(「m」) if($YYYY==") $YYY = ダテ(Y) if(checkdate($MM,1、$YYY)){ $ストリングDate = striftime('%d %b %Y「mktime」 (0,0,0,MM,1,$YYY); $days = streftime("%d"mktime) (0,0,0,$MM+1,0,$YYY); $first Day = streftime("%w"mktime) (0,0,0,MM,1,$YYY); $lastDay = streftime("%w"mktime) (0,0,0,MM、$days、$YYY); $print Days = $days; $preMonth = streftime("%m",mktime) (0,0,0,$MM-1,1,YYY); $preYear = striftime("%Y",mktime) (0,0,0,$MM-1,1,YYY); $next Month = streftime("%m",mktime) (0,0,0,$MM+1,1,$YYY); $nextYear = striftime("%Y",mktime) (0,0,0,$MM+1,1,$YYY); print(< border=\"1\" cell padding=\"1\" cell pacing=\"1\""""); print('“)”; print("th" colspan=\"5\" valign=\"top\""".striftime("%b %Y「mktime」 (0,0,0,$MM,1,$YYY).「 “)”; print("1){ for($x=$lastDay;$x>=0;x--){ $print Days = $days-$x; print(< “); } for($y=firstDay)$y<7;y++){ print(<); $currentDays+; } } elseif($firstDay)=0 && $currentDays==1){ for($z=1;$z<==firstDay;$z+){ print(<“); } for($y=firstDay)$y<7;y++){ print(<); $currentDays+; } } else { for($u=1;)u<=7 && $currentDays=$days;u++){ print(<); $currentDays+; } } print('/tr') } print('/table') } } ?>
$print Days>); } for($z=1;$z<$firstDay-$lastDay;$z+){ print(< | $currentDays | $currentDays | $currentDays |