Is there a way in PHP to keep a file open and process each line and subsequent lines?
        Posted  
        
            by Chris Denman
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by Chris Denman
        
        
        
        Published on 2010-03-22T17:53:18Z
        Indexed on 
            2010/03/22
            18:21 UTC
        
        
        Read the original article
        Hit count: 471
        
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
© Stack Overflow or respective owner