Parse Apache log in PHP using preg_match

后端 未结 5 1070
日久生厌
日久生厌 2020-12-23 14:34

I need to save data in a table (for reporting, stats etc...) so a user can search by time, user agent etc. I have a script that runs every day that reads the Apache Log and

5条回答
  •  时光取名叫无心
    2020-12-23 15:07

    If you don't want to capture the double quotes, move them out of the capture groups.

     (\".*?\") 
    

    Should become:

     \"(.*?)\"
    

    As alternative you could just post-process the entries with trim($str, '"')

提交回复
热议问题