[PHP]Gunzip problem

2005-04-20 Thread Oskar
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))."-");
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))."-");
gzclose($handle);

the RESULT will be:
-one-
-two-
-three-

SEE? The last (empty) line is not returned .

What am I doing wrong?

OKi98


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] copy a string

2002-08-21 Thread Oskar Hermansson

Hello!

Is there any function to copy a string into the computers memory (just
like you do when you press "ctrl + c" in, for example Internet
Explorer). Is there any way to do this, just using PHP or JavaScript?
Maybe by using the function system()? Note that i dont want to copy a
file, just a string.

Anyone got a solution to this problem?

Im very grateful for any help i can get!

 

With Regards,

Oskar Hermansson,

Sweden