$arFilter = Array("IBLOCK_ID"=>$IBLOCK_ID, "SECTION_ID"=>$SECTION_ID, "ACTIVE_DATE"=>"Y", "ACTIVE"=>"Y");
$file = 'http://www.domain.com/somefile.jpg';
$file_headers = @get_headers($file);
if(!$file_headers || $file_headers[0] == 'HTTP/1.1 404 Not Found') {
$exists = false;
} else {
$exists = true;
}
function url_exists($url) {
if (!$fp = curl_init($url)) return false;
return true;
}