note 103380 deleted from function.get-headers by danbrown

From: Date: Mon, 11 Apr 2011 15:12:59 +0000
Subject: note 103380 deleted from function.get-headers by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-178689@lists.php.net to get a copy of this message
Note Submitter: okfgf at jadamspam dot pl ---- 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 )

« previous php.notes (#178689) next »