更新された回答:
サーバーが大文字と小文字を正しく使用することを保証できない場合は、 を使用array_change_key_case
して名前付きキーを変更できます。
<?php
$original = array('Content-type'=>'text/html');
echo $original['Content-Type']; // Notice: Undefined index
$fixed = array_change_key_case($original, CASE_LOWER);
echo $fixed['content-type']; // prints 'text/html'
?>
古い答え:
これは完全に機能するため、質問を拡張する必要があります。
PHP:
<?php
$url = 'http://www.mysite.com/dev/blah.php?blah=1:2:3';
print_r(get_headers($url));
?>
出力:
Array
(
[0] => HTTP/1.1 200 OK
[1] => Date: Tue, 22 Feb 2011 18:28:20 GMT
[2] => Server: Apache
[3] => Connection: close
[4] => Content-Type: text/html
)
出力 2: (OP によって指定された URL を使用)
Array
(
[0] => HTTP/1.0 200 OK
[1] => Etag: "8b48b69ed24101b9a235e0168874c720"
[2] => Content-type: image/jpeg; charset=utf-8
[3] => Content-Length: 482111
[4] => Connection: close
[5] => Date: Wed, 23 Feb 2011 19:50:42 GMT
[6] => Server: lighttpd/wikidot
)