Verifique se há links válidos (não mortos) usando PHP

function is_available($url, $timeout = 30) {
$ch
= curl_init(); // get cURL handle
$opts
= array(
CURLOPT_RETURNTRANSFER
=> true,
CURLOPT_URL
=> $url,
CURLOPT_NOBODY
=> true
CURLOPT_TIMEOUT
=> $timeout
);
curl_setopt_array
($ch, $opts);
curl_exec
($ch);
$retval
= curl_getinfo($ch, CURLINFO_HTTP_CODE) == 200;
curl_close
($ch);
return $retval;
}