非常简单实用的函数,这里就不多废话了,直接奉上代码
<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 da<em>8本文来源gao.dai.ma.com搞@代*码(网$</em><pre>搞代gaodaima码
te(‘L’, $year);
}
以上就是本代码的全部内容,希望小伙伴们喜欢。