Home >php教程 >php手册 >PHP输出日历表代码实例

PHP输出日历表代码实例

WBOY
WBOYOriginal
2016-06-06 20:05:532093browse

这篇文章主要介绍了PHP输出日历表代码实例,本文直接给出代码实例,需要的朋友可以参考下

月历表 "); $ym = $year . "年". $MONTH[$mon]; echo("

$ym

"); echo(""); for ($i=0; $i"); echo("

$WEEK[$i]

"); echo(""); } 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(""); } ?>

请输入要查看的年号和月份(查询范围为1970年1月1日至2038年)

= 1970 && $year = 1 && $month "); } } else if($year != NULL) { echo("年份不对" . "
"); } ?>
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn