PHP Classes

PHP HTTP gzip Response Encoding: Compress the output of a Web request PHP script

Recommend this page to a friend!
     
  Info   Example   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 78 All time: 10,145 This week: 673Up
Version License PHP version Categories
encodecloseconnectio 1.0.0GNU General Publi...5HTTP, PHP 5, Compression
Description 

Author

This class can compress the output of a Web request PHP script.

It can start capturing the output of the current HTTP request.

The class can compress the whole script output using the gzip compression method and outputs the compressed output with the necessary headers to tell the user browser to decompress it on the browser side.

Picture of Ujah Chigozie peter
  Performance   Level  
Name: Ujah Chigozie peter <contact>
Classes: 28 packages by
Country: Nigeria Nigeria
Age: 33
All time rank: 198810 in Nigeria Nigeria
Week rank: 10 Up1 in Nigeria Nigeria Up
Innovation award
Innovation award
Nominee: 11x

Example

<?php
include_once("Encode.class.php");
$encode = new Encode($_SERVER['HTTP_ACCEPT_ENCODING']);
ob_start('Encode::removeWhitespace');
?>
<html>
<bod>
    <div>
        <h3>Hello world</h3>

        <p>This will be encoded</p>
    </div>
</bod>
</html>
<?php $encode->closeConnection(ob_get_contents(), 200, 'HTML');


  Files folder image Files (2)  
File Role Description
Plain text file Encode.class.php Class Endcode php class
Accessible without login Plain text file EncodeExample.php Example Example

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 0%
Total:78
This week:0
All time:10,145
This week:673Up