对于数据中的每一行,我都会收到此错误。因此大约有500次,但每次都有另一个未定义的偏移量。 这是我的代码:
$fl_array = preg_grep('/^\d+\s('. $SelectedTime .':)\d+/', explode("\n", $finalLog));
$count = count($fl_array);
for ($x = 0; $x < $count; $x++)
{
echo "$fl_array[$x] \n";
}
答案 0 :(得分:0)
如此处所写-http://php.net/manual/en/function.preg-grep.php:Returns an array indexed using the keys from the input array.
,所以您的按键可能有误:
if (isset($fl_array[$x])) {
echo "$fl_array[$x] \n";
}