How do I check if a URL exists (not 404) in PHP?
function urlIsOk($url) { $headers = @get_headers($url); $httpStatus = intval(substr($headers[0], 9, 3)); if ($httpStatus<400) { return true; } return false; }