Published:
February 10, 2011How to check if requested url exits or not
$requestedUrl = “http://www.example.com/abc.php”;
$tags = get_headers($requestedUrl);
if(preg_match(“/Not Found/i”,$tags[0]) || preg_match(“/Service Unavailable/i”,$tags[0]))
{
echo “Requested Url does not exists”;
}
else
{
echo “Requested Url exists”;
}