I have a lot of include files. Some of them can be pretty large. I often need to retrieve their first line only, and for that I am using:
$file = file("somefile.inc", "r");
$firstline = $file [0];
print "$firstline";
It works fine, but it obviously parses and loads the entire file to the $file array and sometimes I only need the first line.
Is there some way I can tell PHP to read the first line only, without even parsing the rest of the file, so as to save some processing power?
Thank you,
Luciano ES
Santos, SP - Brasil