Here is a solution that reads only the first byte of source code... returning false if the file_get_contents fails... This will also work for remote files like images.
function urlExists($url)
{
if (@file_get_contents($url,false,NULL,0,1))
{
return true;
}
return false;
}