非常簡單實用的函數,這里就不多廢話了,直接奉上代碼
			 
			復制代碼代碼如下:
			
		/**
		     *    日期-獲取當月最后一天
		     *  @return int
		     */
		    public function get_lastday() {
		        if($this->month==2) {
		            $lastday = $this->is_leapyear($this->year) ? 29 : 28;
		        } elseif($this->month==4 || $this->month==6 || $this->month==9 || $this->month==11) {
		            $lastday = 30;
		        } else {
		            $lastday = 31;
		        }
		        return $lastday;
		    }
		    /**
		     *    日期-是否是閏年
		     *  @return int
		     */
		    public function is_leapyear($year) {
		        return date('L', $year);
		    }
			 
			以上就是本代碼的全部內容,希望小伙伴們喜歡。