Help me parse this file with PHP

后端 未结 4 1031
囚心锁ツ
囚心锁ツ 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:58

    It appears to be fixed column width. You're going to need to either:

    • Use substr() and extract each column, then trim whitespace
    • Use preg_split() and look for two or more spaces in a row '/\s+/'
    • Other

    Explode will likely return a bunch of empty elements, since it only matches a single character / one space.

提交回复
热议问题