0

I am trying to fetch contents from a website using CURL in PHP. However, the issue is , the site is returning most probably a deflated or gzipped contents. See contents here and actual website here.

Is there any way to get the contents back. I need to retrieve the values available on the website. Any link or suggestion for this will be appreciated.

Thanks !

4

2 回答 2

3

在您的 curl 设置中指定:

Accept-Encoding: gzip, deflate

作为标题之一。

未经测试,但我相信它设置为:

curl_setopt($ch,CURLOPT_ENCODING , "gzip");
于 2012-11-05T20:23:40.350 回答
1

您可以将收到的 gzip 压缩文件加载到变量中,然后使用gzuncompress()

于 2012-11-05T20:14:05.137 回答