我有这段代码可以获取$from和 $to范围内的所有日期。
//get All days within the range.
$sStartDate = gmdate("Y-m-d", strtotime($from));
$sEndDate = gmdate("Y-m-d", strtotime($to));
$aDays[] = $sStartDate;
$sCurrentDate = $sStartDate;
$allDays[] = $sStartDate;
while($sCurrentDate < $sEndDate){
$sCurrentDate = gmdate("Y-m-d", strtotime("+1 day", strtotime($sCurrentDate)));
$allDays[] = $sCurrentDate;
}
它在我的浏览器和计算机上运行良好,但在我同事的本地主机上运行良好,我收到致命错误:超过 30 秒的最大执行时间