本文实例讲述了PHP实现的日历程序。分享给大家供大家参考。具体如下:
PHP;">
PHP
////判断$Year和$Month是否为空,如果为空就获取系统当前日期,否则用$_GET获取
$Year = empty($_GET['Year']) ? date("Y"): $_GET["Year"];
$Month = empty($_GET['Month']) ? date("m"): $_GET["Month"];
////获取当前日期////
$Today = date("Ymj");
////初始化日期数组////
$Maxday = array("1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24","25","26","27","28","29","30","31");
$Maxday_count = count($Maxday);
////初始化星期数组////
$Weekday = array("Sun","Mon","Tue","Wed","Thu","Fri","Sat");
$Weekday_count = count($Weekday);
$daynum = 0;
$space = "