Issue a HTTP HEAD request and check for the returned headers. Look at the fsockopen() function in the manual, it gives you an example; just replace the line with GET by these ones :
fputs($fp, "HEAD $path HTTP/1.1\r\n");
fputs($fp, "Host: $host\r\n");
fputs($fp, "\r\n");
Before doing this, use the parse_url() function to extract all the components (host, port, path...) of the URL.
The HTTP return code comes in the first header line :
HTTP/1.1 code message
Check for the different possible values (corresponding to Ok, Not found, Redirection, Not authorized...).