Suppose you have a thumbnail generator script that accepts source images in the form of a URL. Is there a way to detect if the source URL is \"broken\" - whether nonexistent
try for local files
for external domains
$headers = @get_headers($url); if (preg_match("|200|", $headers[0])) { // file exists } else { // file doesn't exist }
Also you can use curl request for the same.