PHP code example of hostbybelle / compressionbuffer

1. Go to this page and download the library: Download hostbybelle/compressionbuffer library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

hostbybelle / compressionbuffer example snippets



use HostByBelle\CompressionBuffer;

ressionBuffer detect & sort the compression methods
ob_start([CompressionBuffer::class, 'handler']); // Register it

// Send some content to the output buffer
echo "Lorem ipsum dolor sit amet, consectetur adipiscing elit,";

// Finally send it to the browser & let CompressionBuffer do it's magic.
ob_end_flush();

CompressionBuffer::enable(); // Enable output compression (enabled by default)
CompressionBuffer::disable(); // Disable output compression
CompressionBuffer::isEnabled(); // Check if it's currently enabled or not