Help me parse this file with PHP

后端 未结 4 979
囚心锁ツ
囚心锁ツ 2021-01-28 17:13
Fri Nov 27 10:00:01 EST 2009         974        12506
Fri Nov 27 11:00:01 EST 2009         988        12655
Fri Nov 27 12:00:01 EST 2009        1005        12886
Fri Nov 27 1         


        
4条回答
  •  醉梦人生
    2021-01-28 17:35

    This'll split at all whitespace collections, regardless of size.

    $lines = file($myfile);
    foreach ($lines as $line) {
        $line = preg_split('/\s+/', $line);
        # do stuff with line
    }
    

提交回复
热议问题