Sends a "HEAD" HTTP command to a server and returns the headers in an associative array.
array - an array containing the header lines or a PEAR_Error.
Example output:
Array ( [response_code] => 200 // The HTTP response code [response] => HTTP/1.1 200 OK // The full HTTP response string [Date] => Fri, 11 Jan 2002 01:41:44 GMT [Server] => Apache/1.3.20 (Unix) PHP/4.1.1 [X-Powered-By] => PHP/4.1.1 [Connection] => close [Content-Type] => text/html ) |
Table 26-1. Possible PEAR_Error values
Error code | Error message | Reason | Solution |
---|---|---|---|
NULL | "HTTP::head Error $errstr ($erno)" | Connection to server failed | Check connectivity of your host and the given URL in $url |