当我执行以下代码时,我收到错误:ERR_RESPONSE_HEADERS_TOO_BIG
:
$i = 1;
foreach ($data as $row){
$timeCheck = explode(":", $this->ticket_model->count_time($row['start_date'], $row['end_date'], $row['start_time'], $row['end_time'], $row['pause_time'], $row['travel_time'], FALSE, FALSE));
if($timeCheck[2] >= 10){
echo $timeCheck[2]." is More<br/>";
}else{
echo $timeCheck[2]." is less<br/>";
}
if($i == 85){
exit;
}
$i++;
}
当我在foreach中更改if语句时如下:
$i = 1;
foreach ($data as $row){
$timeCheck = explode(":", $this->ticket_model->count_time($row['start_date'], $row['end_date'], $row['start_time'], $row['end_time'], $row['pause_time'], $row['travel_time'], FALSE, FALSE));
if($timeCheck[2] >= 10){
echo $timeCheck[2]." is More<br/>";
}else{
echo $timeCheck[2]." is less<br/>";
}
if($i == 5){
exit;
}
$i++;
}
它运作得很好。
**请注意,我只更改了if($ i == 5)语句。 **
有没有办法解决这个问题?
答案 0 :(得分:0)
怎么样:
for($i=0; sizeof($data) < 85; $i++){
//and then modify $timeCheck sth like:
$timeCheck = explode(":", $this->ticket_model->count_time($data[$i]['start_date'], $data[$i]['end_date'], $data[$i]['start_time'], $data[$i]['end_time'], $data[$i]['pause_time'], $data[$i]['travel_time'], FALSE, FALSE));
//etc ...
//and the part with if($i > 85 ) should be excluded, as it is controlled with for loop
}