Is there a way in PHP to keep a file open and process each line and subsequent lines?
- by Chris Denman
I want to write a php script that keeps the apache_log file open and "listen" to the log and deal with each log entry as it happens.
I'm thinking that I need to open a file, get the number of lines, then do this again in a loop - and when the size is different, read the new lines and process them.
Am I barking up the wrong tree, or is there a silly easy solution that I have missed?
Chris