标签:day 获取 strtotime 范围 turn lan rto pre date
//php获取指定范围内的日期
function periodDate($startDate, $endDate)
{
$startTime = strtotime($startDate);
$endTime = strtotime($endDate);
$arr = [];
while ($startTime <= $endTime)
{
$arr[] = date(‘Y-m-d‘, $startTime);
$startTime = strtotime(‘+1 day‘, $startTime);
}
return $arr;
}
#使用
$time = periodDate(‘1912-01-01‘,‘2031-12-31‘);
标签:day 获取 strtotime 范围 turn lan rto pre date
原文地址:https://www.cnblogs.com/ljkltt/p/14692597.html