2012-07-13 51 views
-1

錯誤輸出:致命錯誤:超過30秒的最大執行時間超出功能的時間

我認爲那裏沒有任何錯誤的東西。哪裏不對?

function advancedSearchAgeOption($selectName, $selectID, $firstValue, $lastValue) { 
    $selectBox.='<select name="'.$selectName.'" id="'.$selectID.'">'; 
    for ($i=$firstValue; $i=$lastValue; $i++) { 
     $selectBox.='<option value="'.$i.'">'.$i.'</option>'; 
    } 
    $selectBox.='</select>'; 
    return $selectBox; 
} 

回答

4

替換此行:

for ($i=$firstValue; $i=$lastValue; $i++) { 

利用該:

for ($i=$firstValue; $i<=$lastValue; $i++) { 

第二個表達式的值應該爲true$i直到結束。

+0

哦謝謝,我還沒有看到。謝謝! – 2012-07-13 10:07:02

+1

請標記爲答案。 – 2012-07-13 10:31:35