PHP自动生成月历代码_php基本功_脚本之家

时间:2020-04-02 11:18来源:澳洲幸运10资讯
Function usage: calendar*/function calendar{ if $MM = date $YYYY =date; if(checkdate{ $stringDate = strftime("%d %b %Y",mktime ; $days =strftime("%d",mktime ; $firstDay = strftime("%w",mktime ; $lastDay =strftime("%w",mktime (0,0,0,$MM,$day

Function usage: calendar*/function calendar{ if $MM = date $YYYY = date; if(checkdate{ $stringDate = strftime("%d %b %Y",mktime ; $days = strftime("%d",mktime ; $firstDay = strftime("%w",mktime ; $lastDay = strftime("%w",mktime (0,0,0,$MM,$days,$YYYY)); $printDays = $days; $preMonth = strftime("%m",mktime ; $preYear = strftime("%Y",mktime ; $nextMonth = strftime("%m",mktime ; $nextYear = strftime("%Y",mktime ; print("

"); print("

P

"); print("

".strftime("%b %Y",mktime ."

"); print("

N

"); print("

"); print("

Sun

Mon

Tue

Wed

Thu

Fri

Sat

"); $currentDays = 1; for{ print("

"); $diffDays = $firstDay-$lastDay; if($firstDay>$lastDay && $currentDays ==1 && { for($x=$lastDay;$x>=0;$x--){ $printDays = $days-$x; print("

$printDays

"); } for($z=1;$z$currentDays"); $currentDays++; } } elseif($firstDay!=0 && $currentDays==1){ for($z=1;$z<=$firstDay;$z++){ print; } for($y=$firstDay;$y<7;$y++){ print("

$currentDays

"); $currentDays++; } } else { for($u=1;$u<=7 && $currentDays<=$days;$u++){ print("

$currentDays

"); $currentDays++; } } print; } print; }}?>

编辑:澳洲幸运10资讯 本文来源:PHP自动生成月历代码_php基本功_脚本之家

关键词: