Is this not reliable? can servers be set up in a way so that it wont work?
The Below code does not give me the output I would expect
<?php
header("Content-type: text/plain");
$url = array();
$url[] = "http://www.espc.com/EspcPublicMedia/RegistrationMedia/242000/242400/242468/Images/242468_a.jpg";
$url[] = "http://www.espc.com/EspcPublicMedia/RegistrationMedia/238000/238400/238477/Images/238477_a.jpg";
$url[] = "http://www.dougalmatthews.com/Default.aspx";
$url[] = "http://www.dougalmatthews.com/Default2.aspx";
foreach ($url as $u){
echo "\n\n". $u ."\n\n";
print_r(get_headers($u));
}
Output below. In the array only one out of the espc.com links work if you follow them and the only the first one of my website works too. However, Default2.aspx on my website returns the code 404 - both results from espc.com return 200. However if you visit them you will get the 404 page missing for one of them...
http://www.espc.com/EspcPublicMedia/RegistrationMedia/242000/242400/242468/Images/242468_a.jpg
Array
(
[0] => HTTP/1.1 200 OK
[1] => Content-Length: 10599
[2] => Content-Type: image/jpeg
[3] => Last-Modified: Mon, 18 Jun 2007 08:04:04 GMT
[4] => Accept-Ranges: bytes
[5] => ETag: "1688df3c7fb1c71:6a5"
[6] => Server: Microsoft-IIS/6.0
[7] => X-Powered-By: ASP.NET
[8] => Date: Thu, 27 Sep 2007 14:11:20 GMT
[9] => Connection: close
)
http://www.espc.com/EspcPublicMedia/RegistrationMedia/238000/238400/238477/Images/238477_a.jpg
Array
(
[0] => HTTP/1.1 200 OK
[1] => Content-Length: 13785
[2] => Content-Type: image/jpeg
[3] => Last-Modified: Mon, 27 Aug 2007 15:08:30 GMT
[4] => Accept-Ranges: bytes
[5] => ETag: "aed5a620bce8c71:6a5"
[6] => Server: Microsoft-IIS/6.0
[7] => X-Powered-By: ASP.NET
[8] => Date: Thu, 27 Sep 2007 14:11:20 GMT
[9] => Connection: close
)
http://www.dougalmatthews.com/Default.aspx
Array
(
[0] => HTTP/1.1 200 OK
[1] => Connection: close
[2] => Date: Thu, 27 Sep 2007 14:11:15 GMT
[3] => Server: Microsoft-IIS/6.0
[4] => X-Powered-By: ASP.NET
[5] => X-AspNet-Version: 2.0.50727
[6] => Cache-Control: private
[7] => Content-Type: text/html; charset=utf-8
[8] => Content-Length: 9273
)
http://www.dougalmatthews.com/Default2.aspx
Array
(
[0] => HTTP/1.1 404 Not Found
[1] => Connection: close
[2] => Date: Thu, 27 Sep 2007 14:11:15 GMT
[3] => Server: Microsoft-IIS/6.0
[4] => X-Powered-By: ASP.NET
[5] => X-AspNet-Version: 2.0.50727
[6] => Cache-Control: private
[7] => Content-Type: text/html; charset=utf-8
[8] => Content-Length: 3511
)