PHP输出日历表代码实例,php输出日历实例_PHP教程
程序员文章站
2024-02-16 17:14:34
...
PHP输出日历表代码实例,php输出日历实例
= 1970 && $year = 1 && $month "); } } else if($year != NULL) { echo("年份不对" . "月历表 "); $ym = $year . "年". $MONTH[$mon]; echo(""); echo(" $ym
"); for ($i=0; $i"); echo(" "); $theWeek = $theDate[wday];//判断当天是星期几 for ($i=0; $i"); for ($j=0; $j"); if ($startdate $theDay"); $startdate = strtotime("+1 day", $startdate); //日期前移1天 $theDate = getdate($startdate);//更新日期 $theWeek = ($theWeek + 1) % 7;//更新星期 } echo(""); } echo(""); if ($startdate == $enddate) //如果已经输出全部日期,结束循环 { $i = 6; } } echo(""); } ?>$WEEK[$i]
"); echo(""); } echo("
"); } ?>
上一篇: 一句代码语法异常,请帮忙解决