podrias usar una funcion,, o 2
Código PHP:
/********************************************************************************/
/* FUNCION PARA SABER SI LAS DESCARGAS ESTAN ACTIVAS */
/********************************************************************************/
function FUNC_urlHeader($url) {
$a_url = parse_url($url);
if (!$a_url[port]) $a_url[port] = 80;
$fid = fsockopen($a_url[host], $a_url[port], $errno, $errstr, $timeout);
if (!$fid) return "Host not responding";
fputs($fid, "HEAD $a_url[path] HTTP/1.0\r\nHost: $a_url[host]\r\n\r\n");
$head = fread($fid, 4096);
fclose($fid);
return $head;
}
function FUNC_urlExiste($url) {
return preg_match('#^HTTP/.*\s+200\sOK\s#i', FUNC_urlHeader($url));
}
//////////////////////////////////////////////////////////////////////////////////