note 44185 added to function.get-headers

From: Date: Sat, 17 Jul 2004 06:44:12 +0000
Subject: note 44185 added to function.get-headers
Groups: php.notes 
Request: Send a blank email to php-notes+get-73428@lists.php.net to get a copy of this message
Note that requesting a page that doesn't exist will cause a warning, "Warning: get_headers(http://somesite/nonexistant.page) [function.get-headers]: failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found". Additionally, if you try a site that doesn't exist, you will get "Warning: get_headers() [function.get-headers]: php_network_getaddresses: getaddrinfo failed: No such host is known." and "Warning: get_headers(http://somesite) [function.get-headers]: failed to open stream: Bad file descriptor" There seems to be no way to trap/avoid this. get_headers() should return an empty array or FALSE to allow for error catching. ---- Manual Page -- http://www.php.net/manual/en/function.get-headers.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+44185 Delete -- http://master.php.net/manage/user-notes.php?action=delete+44185&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+44185&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#73428) next »