

if (preg_match("/http(s?):\/\/([\w-]+\.)+[\w-]+(\/[\w- .\/\?%&=]*)?/i", $url_to_parse))
{
//URL is valid, do stuff
}
function if_url_exist($url) {
$fp = @fopen($url,"r");
if ($fp) {
fclose($fp);
$ret ="Y";
} else {
$ret ="N";
}
return $ret;
}
//test
$url="http://www.bigvertiser.com";
$test = if_url_exist($url);
echo $test;




