I am trying to read large .gz file line by line. Here is what i got so far:
$sfp = gzopen($filename, "rb");
while (!gzeof($sfp))
{
$line = gzread($sfp, 4096);
}
and thats where the problem comes in, gzread reading the length specified in variable (in this case 4096) and ignoring new lines .
I checked "fget" function and it works properly, so its reading line limiting the size by hitting new line or the size which ever comes first. How I can do the same with gzread or any work around ?
See Question&Answers more detail:os