两个日期之间的所有时间

2019PHP高薪工程师学习路线图....>>>

function DateRange ($begin,$end,$interval='M'){
	$begin = new DateTime($begin);
	$end   = new DateTime($end);
	$end = $end->modify('+1 day');
	$t ='P1'.$interval;
	$interval = new DateInterval($t);
	$daterange = new DatePeriod($begin, $interval ,$end);

	foreach($daterange as $date){
		$range[]= $date->format("Ymd");
	}
	return $range;
}