Da wird nichts ausgegeben.
Aber ich meine diesen Code:
Aber ich meine diesen Code:
Code:
# Start gzip function checkCanGzip() { global $HTTP_ACCEPT_ENCODING; if (headers_sent()) return 0; if (strpos($HTTP_ACCEPT_ENCODING, 'x-gzip') !== false) return "x-gzip"; if (strpos($HTTP_ACCEPT_ENCODING,'gzip') !== false) return "gzip"; return 0; } function gzDocOut() { if ($encoding = checkCanGzip()) { $contents = ob_get_contents(); ob_end_clean(); header("Content-Encoding: ".$encoding); print("x1fx8bx08x00x00x00x00x00"); $size = strlen($contents); $contents = gzcompress($contents, 9); $contents = substr($contents, 0, $size); print($contents); //print(pack('V', crc32($contents))); //print(pack('V', $size)); exit(); } else { ob_end_flush(); exit(); } } ob_start(); ob_implicit_flush(0); # Ende Gzip
Kommentar