php获取当月最后一天函数分享
非常简单实用的函数,这里就不多废话了,直接奉上代码
/**
* 日期-获取当月最后一天
* @returnint
*/
publicfunctionget_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;
}
/**
* 日期-是否是闰年
* @returnint
*/
publicfunctionis_leapyear($year){
returndate('L',$year);
}
以上就是本代码的全部内容,希望小伙伴们喜欢。
热门推荐
10 财运虎年祝福语简短语
11 单亲爸爸春节祝福语简短
12 狗狗上厕所训练
13 植物种植祝福语简短
14 翻译考试祝福语朋友简短
15 个人周年庆简短祝福语
16 狗狗怎么训练
17 分别祝福语简短搞笑英文
18 生日广州男生祝福语简短