function getStartAndEndTimeByDate($start, $end)
{
$dt_start = strtotime($start);
$dt_end = strtotime($end);
$arr = [];
while ($dt_start <= $dt_end) {
$arr[] = date('Y-m-d', $dt_start);
$dt_start = strtotime('+1 day', $dt_start);
}
return $arr;
}
$qipa_day = getStartAndEndTimeByDate('2023-12-01','2023-12-12');
echo "<pre>";
print_r($qipa_day);
效果图: