0
私は、get_headers($ url、1)というウェブサイトのヘッダーを取得するために関数http://www.sportsmalayalam.com/を使用しています。 'コンテンツエンコーディング'はありませんが、Google Chromeを使用して同じウェブサイトのヘッダーをチェックして、コンテンツのエンコーディングをgzipとして表示しています。get_headers()はPHPでコンテンツエンコーディングを表示していません
実行中:print_r(get_headers($ url、1)); GoogleのChromeから
Array (
[0] => HTTP/1.1 200 OK
[1] => Date: Fri, 29 Apr 2016 10:35:20 GMT
[2] => Content-Type: text/html; charset=UTF-8
[3] => Connection: close
[4] => Set-Cookie: __cfduid=d564038ff91bf8887430482dc8a8cf74b1461926119; expires=Sat, 29-Apr-17 10:35:19 GMT; path=/; domain=.sportsmalayalam.com; HttpOnly
[5] => X-Powered-By: PHP/5.5.9-1ubuntu4.16
[6] => Set-Cookie: PHPSESSID=empthbjqo968ak1a3cbaa6jr67; path=/
[7] => Expires: Thu, 19 Nov 1981 08:52:00 GMT
[8] => Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
[9] => Pragma: no-cache
[10] => Link: ; rel="https://api.w.org/"
[11] => Link: ; rel=shortlink
[12] => Vary: Accept-Encoding, Cookie
[13] => Server: cloudflare-nginx
[14] => CF-RAY: 29b21b47261e2fab-MAA
)
だから私はgzipを扱うことができるという要求を送る必要がありますか? –
はい。デフォルトは「圧縮しない」です。クライアントは*明示的にそれを要求する必要があります。 – Piskvor
どうすれば送信できますか? –