This article mainly introduces the calendar program implemented in PHP. Friends who are interested can refer to it. I hope it will be helpful to everyone.
The details are as follows:
"; echo "Back"; exit(); } ?>
if($month<1){ $month=12; $year-=1; } if($month>12){ $month=1; $year+=1; } //<-------当月份超出1至12时的处理;结束-------> //<---------上一年,下一年,上月,下月的连接处理及输出;开始---------> echo "<<年>>"; ?> | <<月>>"; //<--------上一年,下一年,上月,下月的连接处理及输出;结束---------> ?> | |||||
日 | 一 | 二 | 三 | 四 | 五 | 六 |
\n"; } if($i==$FirstDay){ echo " | ".font_style($month,1,$year)."1 | \n"; if($FirstDay==6){//判断1号是否星期六 echo "".font_style($month,$i,$year)."$i | \n"; if(date("w",mktime(0,0,0,$month,$i,$year))==6){//判断该日是否星期六 echo "\n"; } } ?>
The calendar effect output by php is as follows:
Summary: The above is the entire content of this article, I hope it will be helpful to everyone's study.
Related recommendations:
How to generate a QR code with logo in PHP
How to implement the Model base class based on mysqli in PHP And examples
Detailed explanation of methods and examples of PHP file upload class
The above is the detailed content of Calendar program implemented in php. For more information, please follow other related articles on the PHP Chinese website!