Ob_start ();
Ob_implicit_flush (0);
function Checkcangzip () {
Global $HTTP _accept_encoding;
if (headers_sent () | | connection_timeout () | | connection_aborted ()) {
return 0;
}
if (Strpos ($HTTP _accept_encoding, ' X-gzip ')!== false) return "X-gzip";
if (Strpos ($HTTP _accept_encoding, ' gzip ')!== false) return "gzip";
return 0;
}
/* $level = Compression level 0-9, 0=none, 9=max */
function Gzdocout ($level =1, $debug =0) {
$ENCODING = Checkcangzip ();
if ($ENCODING) {
print "\ n \ n ";
$Contents = Ob_get_contents ();
Ob_end_clean ();
if ($debug) {
$s = "
Not compress length: ". strlen ($Contents);
$s. = "
Compressed length: ". strlen (Gzcompress ($Contents, $level));
$Contents. = $s;
}
Header ("Content-encoding: $ENCODING");
print "\x1f\x8b\x08\x00\x00\x00\x00\x00";
$Size = strlen ($Contents);
$CRC = CRC32 ($Contents);
$Contents = Gzcompress ($Contents, $level);
$Contents = substr ($Contents, 0, strlen ($Contents)-4);
Print $Contents;
Print Pack (' V ', $CRC);
Print Pack (' V ', $Size);
Exit
}else{
Ob_end_flush ();
Exit
}
}
?>
The above describes the general violations of how much is divided into a penalty node collection of a PHP thief's core program, including the general violation of how many divided into a penalty node aspects of the content, I hope that the PHP tutorial interested in a friend helpful.