PHP: list number of times a word was found?

lancyhomes

New Member
I got a custom log, roughly 29MBs of user's data, including user agent. I want to parse through it (essentially just search) and find how many occurances of say, "Firefox" or "MSIE" appear in it, like a mini log parser.This is where I am stumped.. What I was getting at is \[code\]explode()\[/code\]ing newlines, and iterate through the array, use: \[code\]if stripos($line, 'Firefox') $ff++;" \[/code\]or something stupid but I realize that would take up a lot of memory/use a lot of functions.What would be a good way to list number of occurances?
 
Back
Top