メモ。
file_get_contents()関数を実行した直後に$http_response_header変数をダンプするとHTTPレスポンスヘッダを取得することが出来る。
file_get_contents('http://example.com');
var_dump($http_response_header);
↓
array(9) {
[0]=>
string(15) "HTTP/1.1 200 OK"
[1]=>
string(35) "Date: Sat, 18 Jan 2014 08:34:35 GMT"
[2]=>
string(31) "Server: Plack::Handler::Starlet"
[3]=>
string(37) "Content-Type: text/xml; charset=utf-8"
[4]=>
string(32) "Vary: User-Agent,Accept-Encoding"
[5]=>
string(20) "X-Framework: JP/4.01"
[6]=>
string(98) "Set-Cookie: ldblog_u=121.107.203.110.1390034075591149; path=/; expires=Fri, 18-Apr-14 08:34:35 GMT"
[7]=>
string(45) "P3P: CP="BUS OUR PHY STP ADM CUR DEV PSA PSD""
[8]=>
string(17) "Connection: close"
}