第一个test.php
out();
第二个日历类:calendar.class.php
year=isset($_get[year]) ? $_get[year] : date(y); $this->month=isset($_get[month]) ? $_get[month] : date(m); $this->start_weekday=date(w, mktime(0, 0, 0, $this->month, 1, $this->year)); $this->days=date(t, mktime(0, 0, 0, $this->month, 1, $this->year)); } function out(){ echo ''; $this->chagedate(test.php); $this->weekslist(); $this->dayslist(); echo '
'; } private function weekslist(){ $week=array('日','一','二','三','四','五','六'); echo ''; for($i=0; $i
'; } //后面几个空格 while($j%7!==0){ echo ' '; $j++; } echo '
'; } private function prevyear($year, $month){ $year=$year-1; if($year 2038) $year=2038; $month=1; }else{ $month++; } return year={$year}&month={$month}; } private function chagedate($url=){ echo ''; echo 'prevyear($this->year, $this->month).'>'.'
'; } }
效果:
http://www.bkjia.com/phpjc/1008856.htmlwww.bkjia.comtruehttp://www.bkjia.com/phpjc/1008856.htmltecharticlephp设计日历类一 (38),日历38 由两个文件组成: 第一个test.php style table { border:1px solid # 050 ; } .fontb { color:white; background:blue; } th { width:30...
