print_r(get_headers('http://forum.csdn.net/PointForum/Manage/TopicManageView.aspx?forumID=94985a29-c8e9-4552-9be4-b01061443744&topicID=0758c3a4-5c85-4434-8a26-0d2c9ccc4c45&date=2012-09-06+21%3a18%3a02&v=-1', 1));
Array
(
[0] => HTTP/1.1 200 OK
[Server] => nginx/0.7.68
[Date] => Thu, 06 Sep 2012 13:29:26 GMT
[Content-Type] => text/html; charset=utf-8
[Connection] => close
[Vary] => Accept-Encoding
[ETag] => ""
[X-UA-Compatible] => IE=EmulateIE7
[X-Powered-By] => ASP.NET
[Cache-Control] => private
[Content-Length] => 4410
)
Array
(
[0] => HTTP/1.1 200 OK
[Server] => nginx/0.7.68
[Date] => Thu, 06 Sep 2012 13:29:26 GMT
[Content-Type] => text/html; charset=utf-8
[Connection] => close
[Vary] => Accept-Encoding
[ETag] => ""
[X-UA-Compatible] => IE=EmulateIE7
[X-Powered-By] => ASP.NET
[Cache-Control] => private
[Content-Length] => 4410
)
如果将可选的 format 参数设为 1,则 get_headers() 会解析相应的信息并设定数组的键名。