$count = 0;
$interpreter->addObserver(function(array $row) use (&$temperature) {
$count+=1;
if ($count < 3) <----- not liking this
{
return;
}
$temperature[] = array(
'column1' => $row[16],
'column2' => $row[18],
);
});
我假設它是一個範圍問題,我無法從外部訪問計數但是我需要計算循環中的行數....想法?注意:未定義的變量:count line 53
我很驚訝你得到這個權利了'$ temperature'但不是'$ count'。 – deceze