PHP获取指定范围内的日期

//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');
原文地址:https://www.cnblogs.com/ljkltt/p/14692597.html