// How can one check to see if a remote file exists using PHP?
$ch = curl_init("http://www.example.com/favicon.ico");
curl_setopt($ch, CURLOPT_NOBODY, true);
curl_exec($ch);
$retcode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
if ($retcode >= 400) {
// $retcode >= 400 -> not found, $retcode = 200, found.
}
// http://stackoverflow.com/questions/981954/how-can-one-check-to-see-if-a-remote-file-exists-using-php