note 42946 added to ref.zlib
| From: | xorinox at tiscali dot ch | Date: | Fri, 04 Jun 2004 11:52:55 +0000 |
| Subject: | note 42946 added to ref.zlib | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-70469@lists.php.net to get a copy of this message | ||
Have a look to this extended version :)
<?php
function compress( $srcFileName, $dstFileName )
{
// getting file content
$fp = fopen( $srcFileName, "r" );
$data = fread ( $fp, filesize( $srcFileName ) );
fclose( $fp );
// writing compressed file
$zp = gzopen( $dstFileName, "w9" );
gzwrite( $zp, $data );
gzclose( $zp );
}
function uncompress( $srcFileName, $dstFileName, $fileSize )
{
// getting content of the compressed file
$zp = gzopen( $srcFileName, "r" );
$data = fread ( $zp, $fileSize );
gzclose( $zp );
// writing uncompressed file
$fp = fopen( $dstFileName, "w" );
fwrite( $fp, $data );
fclose( $fp );
}
compress( "tmp/supportkonzept.rtf", "tmp/_supportkonzept.rtf.gz" );
uncompress( "tmp/_supportkonzept.rtf.gz", "tmp/_supportkonzept.rtf", filesize(
"tmp/supportkonzept.rtf" ) );
?>
----
Manual Page -- http://www.php.net/manual/en/ref.zlib.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+42946
Delete -- http://master.php.net/manage/user-notes.php?action=delete+42946&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+42946&report=yes
Search -- http://master.php.net/manage/user-notes.php