Hi,
I am trying to achieve two things with text files in PHP.
Firstly, is there a way to find out how many lines there are in a text file? I have found out to how determine the size of the file in bytes, but ideally I need to find out how to work it out in lines.
Secondly, can I somehow tell fgets() which line to start reading at? Currently, I loop fgets() $x number of times depending on which line I need to get to, although the text files I am dealing with could quite easily grow to 10000s of lines and pointlessly looping could soon cause considerable wasted cpu cycles.
Any ideas?
Thanks!