获取日期-致命错误:超过了30秒的最长执行时间


Get Dates - Fatal Error: Maximum Execution Time Of 30 Seconds Exceeded

我有这个代码来获取$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秒的最长执行时间

因为$upstream$downstream都不小于0

两个值都大于零。

这将导致两个条件都评估为true:

$upstream = -0.0076675415;
$downstream = -0.0067863464;

(就您的代码而言)PHP在将这些条件评估为false时肯定是正确的。

它们都大于0。

0=零0.000000001=大于零