欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

php獲取當(dāng)月最后一天函數(shù)分享

 更新時(shí)間:2015年02月02日 14:24:15   投稿:hebedich  
這篇文章主要介紹了php獲取當(dāng)月最后一天函數(shù)分享,需要的朋友可以參考下

非常簡單實(shí)用的函數(shù),這里就不多廢話了,直接奉上代碼

復(fù)制代碼 代碼如下:

/**
     *    日期-獲取當(dāng)月最后一天
     *  @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);
    }

以上就是本代碼的全部內(nèi)容,希望小伙伴們喜歡。

相關(guān)文章

最新評論