coding problem is good. What we are talking about here is how to grab the Gzip page. How to judge? The Content-Encoding: gzip in the header is GZIP compressed. If you look at it with FireBug, you know that the page is gzip. Next is to use firebug to check the header information of my blog, and Gzip is open.
[code]Accept text/html, application/xhtml XML, application/xml; q=0.9, * / *; q=0.8
Accept-Encoding gzip. 1335411401.1537; __utmz=225240837.1326850415.887.3.utmcsr=google|utmccn= (organic) |utmcmd=organic|utmctr= will not be so simple as site:www.nowamagic.net; PHPSESSID=888mj4425p8s0m7s0frre3ovc7; __utmc=225240837; __utmb= 225240837.1.10.1335411401
Host www.nowamagic.net
User-Agent Mozi Lla/5.0 (Windows NT 5.1; rv:12.0) Gecko/20100101 Firefox/12.0[/code]
below to introduce some solutions:
1. uses a zlib library with its own zlib library
if the server has installed a library, the following code can easily be used to solve the problem of chaos.
[code]$data = file_get_contents (.Quot; compress.zlib://.quot;.$url); [/code]
2. using CURL instead of file_get_contents
$content = curl_exec.