非常简单实用的函数,这里就不多废话了,直接奉上代码
<br />/**<br /> * 日期-获取当月最后一天<br /> * @return int<br /> */<br /> public function get_lastday() {<br /> if($this->month==2) {<br /> $lastday = $this->is_leapyear($this->year) ? 29 : 28;<br /> } elseif($this->month==4 || $this->month==6 || $this->month==9 || $this->month==11) {<br /> $lastday = 30;<br /> } else {<br /> $lastday = 31;<br /> }<br /> return $lastday;<br /> }<br /> /**<br /> * 日期-是否是闰年<br /> * @return int<br /> */<br /> public function is_leapyear($year) {<br /> return date(<mark style="color:transparent">来4源gaodaimacom搞#代%码*网</mark><code>搞代gaodaima码</code>'L', $year);<br /> }<br />
以上就是本代码的全部内容,希望小伙伴们喜欢。