时间:2021-07-01 10:21:17 帮助过:3人阅读
1 /** 2 * 日期-获取当月最后一天 3 * @return int 4 */ 5 public function get_lastday() { 6 if($this->month==2) { 7 $lastday = $this->is_leapyear($this->year) ? 29 : 28; 8 } elseif($this->month==4 || $this->month==6 || $this->month==9 || $this->month==11) { 9 $lastday = 30; 10 } else { 11 $lastday = 31; 12 } 13 return $lastday; 14 } 15 16 17 18 /** 19 * 日期-是否是闰年 20 * @return int 21 */ 22 public function is_leapyear($year) { 23 return date('L', $year); 24 }
http://www.bkjia.com/PHPjc/951421.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/951421.htmlTechArticlephp 日期,php 1 /* * 2 * 日期-获取当月最后一天 3 * @return int 4 */ 5 public function get_lastday() { 6 if ( $this -month==2 ) { 7 $lastday = $this -is_leapyear( $this...