-
- header("content-type:text/html;charset=utf-8");
- ?>
-
-
- /**
- * Simple and practical php calendar code
- * edit: bbs.it-home.org
- */
- if(!emptyempty($_GET)){
- $year = $_GET['year'];
- $month = $_GET['month'];
- }
- if(emptyempty($year)){
- $year = date('Y');
- }
- if(emptyempty($month)){
- $month = date('m');
- }
- $start_weekday = date('w',mktime(0,0,0,$month,1,$year));
- //echo $start_weekday;
- $days = date('t',mktime(0,0,0,$month,1,$year));
- //echo $days;
- $week = array('星期日','星期一','星期二','星期三','星期四','星期五','星期六');
- $i = 0;
- $k = 1;
- $j = 0;
- echo '';
-
- function lastYear($year,$month){
- $year = $year-1;
- return "year=$year&month=$month";
- }
- function lastMonth($year,$month){
- if($month == 1){
- $year = $year -1;
- $month = 12;
- }else{
- $month--;
- }
- return "year=$year&month=$month";
- }
- function nextYear($year,$month){
- $year = $year+1;
- return "year=$year&month=$month";
- }
- function nextMonth($year,$month){
- if($month == 12){
- $year = $year +1;
- $month = 1;
- }else {
- $month++;
- }
- return "year=$year&month=$month";
- }
- ?>
复制代码
>>>> Articles you may be interested in:
php calender calendar code (solve 2038 problem)
php calendar code (with demo effect)
php calendar code efficient calendar code implemented in php
php calendar code Three good php calendar codes
Share an example of PHP simple calendar code
PHP simple calendar implementation code (can bind events)
|