note 103380 added to function.get-headers

From: Date: Mon, 11 Apr 2011 11:58:37 +0000
Subject: note 103380 added to function.get-headers
Groups: php.notes 
Request: Send a blank email to php-notes+get-178682@lists.php.net to get a copy of this message
As bretticus mentioned, function actually sends the "GET" header and NOT the "HEAD" which seems to be a bug that should be corrected in future versions. Currently, the use of: <?php $tmp = get_headers('http://example.com'); print_r($tmp); ?> is exactly the same as: <?php file_get_contents('http://example.com'); print_r($http_response_header); ?> result in both cases: Array ( [0] => HTTP/1.0 302 Found [1] => Location: http://www.iana.org/domains/example/ [2] => Server: BigIP [3] => Connection: close [4] => Content-Length: 0 [5] => HTTP/1.1 200 OK [6] => Server: Apache/2.2.3 (CentOS) [7] => Last-Modified: Wed, 09 Feb 2011 17:13:15 GMT [8] => Content-Type: text/html; charset=UTF-8 [9] => Accept-Ranges: bytes [10] => Connection: close [11] => Date: Mon, 11 Apr 2011 11:36:12 GMT [12] => Age: 2 [13] => Content-Length: 2945 ) ---- Server IP: 69.147.83.197 Probable Submitter: 83.24.237.127 ---- Manual Page -- http://www.php.net/manual/en/function.get-headers.php Edit -- https://master.php.net/note/edit/103380 Del: integrated -- https://master.php.net/note/delete/103380/integrated Del: useless -- https://master.php.net/note/delete/103380/useless Del: bad code -- https://master.php.net/note/delete/103380/bad+code Del: spam -- https://master.php.net/note/delete/103380/spam Del: non-english -- https://master.php.net/note/delete/103380/non-english Del: in docs -- https://master.php.net/note/delete/103380/in+docs Del: other reasons-- https://master.php.net/note/delete/103380 Reject -- https://master.php.net/note/reject/103380 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#178682) next »