Calendar program implemented in php

墨辰丷
Release: 2023-03-30 08:52:02
Original
2709 people have browsed it

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(); } ?> "; }else{ $FontStyle=""; } return $FontStyle; } for($i=0;$i<=$FirstDay;$i++){//此for用于输出某个月的一号位置 for($i;$i<$FirstDay;$i++){ echo "\n"; } if($i==$FirstDay){ echo "\n"; if($FirstDay==6){//判断1号是否星期六 echo ""; } } } $countMonth=date("t",mktime(0,0,0,$month,1,$year));//某月的总天数 for($i=2;$i<=$countMonth;$i++){//输出由1号定位,随后2号直至月尾的所有号数 echo "\n"; if(date("w",mktime(0,0,0,$month,$i,$year))==6){//判断该日是否星期六 echo "\n"; } } ?> 
if($month<1){ $month=12; $year-=1; } if($month>12){ $month=1; $year+=1; } //<-------当月份超出1至12时的处理;结束-------> //<---------上一年,下一年,上月,下月的连接处理及输出;开始---------> echo "<<>>"; ?> <<月>>"; //<--------上一年,下一年,上月,下月的连接处理及输出;结束---------> ?>
".font_style($month,1,$year)."1
".font_style($month,$i,$year)."$i
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!