I want to read a file line by line, but without completely loading it in memory.
My file is too large to open in memory, and if try to do so I always get out of memo
There is a file() function that returns an array of the lines contained in the file.
file()
foreach(file('myfile.txt') as $line) { echo $line. "\n"; }