1, Use the mktime() function to get the number of days in the current month and the week on the 1st of the month (2018/3/13)
2, Output the header information of the calendar
"; echo"
"; echo"
{$year}年{$mon}月
"; echo "
"; echo "
日
"; echo "
一
"; echo "
二
"; echo "
三
"; echo "
四
"; echo "
五
"; echo "
六
"; echo "
";
3, Traverse the output calendar
Analysis:
From the mktime() function, we can know the total number of days in the current month. The day of the week is the 1st of the month. It only needs to be less than the total number of days in the current month. Each time, 7-day traversal output is performed.
Start from the day of the week corresponding to the 1st of the month and add 1 every day. The 7-day cycle is one row of data, so the calendar comes out
The courseware is not available for download at the moment. The staff is currently organizing it. Please pay more attention to this course in the future~
Students who have watched this course are also learning