Gunzip problem
| From: | Oskar | Date: | Wed, 20 Apr 2005 10:09:22 +0000 |
| Subject: | Gunzip problem | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-213484@lists.php.net to get a copy of this message | ||
Hello,
I have txt file "text.txt" that contains:
line1:one
line2:two
line3:three
line4:
Line 4 contains empty string.
If I use f*() functions to read from the file:
$handle=fopen("text.txt","r");
while (!feof($handle)) echo("-".chop(fgets($handle))."-<BR>");
fclose($handle);
the RESULT will be:
-one-
-two-
-three-
--
I gzipped the file using ZLIB functions.
If I use gz*() function to read from the gzip file:
$handle=gzopen("text.txt.gz","r");
while (!gzeof($handle)) echo("-".chop(gzgets($handle))."-<BR>");
gzclose($handle);
the RESULT will be:
-one-
-two-
-three-
SEE? The last (empty) line is not returned .
What am I doing wrong?
OKi98