Voodoo\Core\Helpers::CompressOutput PHP Method

CompressOutput() public static method

Will send the the header etc Good when sending a lot of JSON to the browser
public static CompressOutput ( $content, $print = true ) :
$content
$print
return
    public static function CompressOutput($content, $print = true)
    {
        // Browser can handle gzip data so send it the gzip version
        if (strstr($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip')) {
            $gzip = gzencode($content, 9, FORCE_GZIP);
            // output the data to the browser
            if ($print) {
                header("Content-Encoding: gzip");
                header("Content-Length: " . strlen($gzip));
                echo $gzip;
            } else {
                return $gzip;
            }
        } else {
            if ($print == true) {
                echo $content;
            } else {
                return $content;
            }
        }
    }