How do I read a file backwards line by line using fseek?
code can be helpful. must be cross platform and pure php.
many thanks in advance
regards
You cannot fseek line by line, because you do not know how long the lines are until you read them.
You should either read the whole file into a list of lines, or if the file is too big for that and you only need the last lines, read fixed-sized chunks from the end of the file and implement a bit more complicated logic which detects lines from such data.