Crazy_shark 的个人博客 / 0 / 1 / 创建于 2年前
public function getMonthRange($start,$end) { $rang=[]; $i=0; do{ $month = date("Ym",strtotime($start.'+'.$i.'month')); $rang[] = $month; $i++; }while($month<$end); }
本作品采用《CC 协议》,转载必须注明作者和本文链接
PHP自带的DateTime:
$a = new \DateTime('now'); $b = new \DateTime('+44 month'); var_dump($a->diff($b)->format('%r%y') * 12 + $a->diff($b)->format('%r%m')); // 12 指一年几个月
我要举报该,理由是:
推荐文章: