Reputation: 68470
The file has text content like:
123
abc
def
xyz
bla bla
...
I want to read it into an array like file() does, but only until it meets a new line.
So in the example above the array should have 123, abc and def lines in it, that's it.
Is it possible without reading the entire file in the array, because I have quite a few of them and each has 100-120 K?
The first lines are the file headers, so I only need the headers to display generic info for many files.
Upvotes: 0
Views: 161
Reputation: 5857
You should use fgets() to read a single line, see: http://php.net/manual/en/function.fgets.php
Upvotes: 2