function check_link_existency($url) {
// Use get_headers() function
$headers = @get_headers($url);
// Use condition to check the existence of URL
if ($headers && strpos($headers[0], '200')) {
echo "URL Exist";
return true;
} else {
echo "URL Doesn't Exist";
return false;
}
}