Generate GZip File using PHP

PHP source code example for generating gzip file using gzencode PHP function. Useful to create backup file, sitemap, compressing data, etc

PHP Example

<?php $data = implode("", file("some_file.php")); $gzdata = gzencode($data, 9); $fp = fopen("some_file.php.gz", "w"); fwrite($fp, $gzdata); fclose($fp); ?>

Love this source code? Please help us to spread it ^_^
 

Discuss

No discussion for this source code yet. Be the first to discuss about this code.

Submit Comment

Sorry, you have to login for joining the discussion

Click here to register or login using your facebook account