I\'m trying to read a specific line from a text file using php. Here\'s the text file:
foo
foo2
How would I get the content of the seco
You could try looping until the line you want, not the EOF, and resetting the variable to the line each time (not adding to it). In your case, the 2nd line is the EOF. (A for loop is probably more appropriate in my code below).
This way the entire file is not in the memory; the drawback is it takes time to go through the file up to the point you want.