php��gzip�ļ������ַ�����ѹʵ���ο�
[����]Ҫ�ɼ�һ����վ��Ŀ��վ������gzipѹ��������ҳ������Ӧ��ֻҪ����һ��httpͷ Accept-Encoding: identity���߸ɴ��������ͷ�ȣ��Ϳ���ʹĿ��վ����û�о���gzipѹ����ҳ���ˣ������ܲ��ң�Ŀ��վ���ӿͻ��˵�����...
Ҫ�ɼ�һ����վ��Ŀ��վ������gzipѹ��������ҳ������Ӧ��ֻҪ����һ��httpͷ Accept-Encoding: identity���߸ɴ��������ͷ�ȣ��Ϳ���ʹĿ��վ����û�о���gzipѹ����ҳ���ˣ������ܲ��ң�Ŀ��վ���ӿͻ��˵���������Ȼ����gzip���ݣ��������롣
��ʵphp��gzip��ѹ�ܼ������õ�gzdecode�����Ϳ����ˣ������ܿ�ϧ�������˰���Ҳ��֧��gzdecode����������ֻ�ñ�ͨһ�£�
if (!function_exists('gzdecode')) {
function gzdecode ($data) {
$flags = ord(substr($data, 3, 1));
$headerlen = 10;
$extralen = 0;
$filenamelen = 0;
if ($flags & 4) {
$extralen = unpack('v' ,substr($data, 10, 2));
$extralen = $extralen[1];
$headerlen += 2 + $extralen;
}
if ($flags & 8) // Filename
$headerlen = strpos($data, chr(0), $headerlen) + 1;
if ($flags & 16) // Comment
$headerlen = strpos($data, chr(0), $headerlen) + 1;
if ($flags & 2) // CRC at end of file
$headerlen += 2;
$unpacked = @gzinflate(substr($data, $headerlen));
if ($unpacked === FALSE)
$unpacked = $data;
return $unpacked;
}
}
function gzdecode ($data) {
$flags = ord(substr($data, 3, 1));
$headerlen = 10;
$extralen = 0;
$filenamelen = 0;
if ($flags & 4) {
$extralen = unpack('v' ,substr($data, 10, 2));
$extralen = $extralen[1];
$headerlen += 2 + $extralen;
}
if ($flags & 8) // Filename
$headerlen = strpos($data, chr(0), $headerlen) + 1;
if ($flags & 16) // Comment
$headerlen = strpos($data, chr(0), $headerlen) + 1;
if ($flags & 2) // CRC at end of file
$headerlen += 2;
$unpacked = @gzinflate(substr($data, $headerlen));
if ($unpacked === FALSE)
$unpacked = $data;
return $unpacked;
}
}
���÷����ܼ�
$f=@file_get_contents("http://www.itlearner.com");
echo gzdecode($f);
echo gzdecode($f);
- ת����ע����Դ��ITѧϰ�� ��ַ��http://www.t086.com/ �����������Ƽ�������
- �ر������� ��վ�������ر�������ֹת�ص�ר�������������¿�������ת�أ���������ע��������ԭʼ���ߡ����°�Ȩ������ԭʼ�������С����ڱ���վת�����µĸ��˺���վ�����DZ�ʾ������л�⡣������վת�ص������а�Ȩ��������ϵ���ǣ����ǻᾡ�����Ը�����
- �������е���ɫ
- ������ϵ��Ц�� (ʷ����ȫ��
- �������ж�IP��ַ��A��B���C��
- ���ٶ�ͳ��URL��hm������utm�����Ķ�Ӧ��ϵ
- ��Google���������ŵ���ͨv4.0
- ��Linux��ʹ��host��dig��nslookup��ѯDNS
- ��ƻ������MACbook Air���ݼ���ȫ
- �����Լ���VPS�Google��������
- ��С�ڴ�VPS֮Nginx+PHP-fpm�߸����Ż���ѹ�����Է���
- ���������ԡ���װ Windows XP ����ϵͳ��ͼ��ȫ����