note 44185 deleted from function.get-headers by tomsommer

From: Date: Sat, 17 Jul 2004 10:21:28 +0000
Subject: note 44185 deleted from function.get-headers by tomsommer
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-73433@lists.php.net to get a copy of this message
Note Submitter: taylor.gerring@gmail.com ---- 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.

« previous php.notes (#73433) next »