6.
Natali0705,
<?php
function parseUrl($url)
{
$r = "^(?:( ?P<scheme>\w+)://)?";
$r .= "(?:( ?P<login>\w+):( ?P<pass>\w+)@)?";
$ip="(?:[0-9]{1,3}+\.){3}+[0-9]{1,3}";//ip check
$s="(?P<subdomain>[-\w\.]+)\.)?";//subdomain
$d="(?P<domain>[-\w]+\.)";//domain
$e="(?P<extension>\w+)";//extension
$r.="(?P<host>(?(?=".$ip.")(?P<ip>".$ip.")|(?:".$s.$d.$e."))";
$r .= "(?::( ?P<port>\d+))?";
$r .= "(?P<path>[\w/]*/(?P<file>\w+(?:\.\w+)?)?)?";
$r .= "(?:\?(?P<arg>[\w=&]+))?";
$r .= "(?:#(?P<anchor>\w+))?";
$r = "!$r!"; // Delimiters
preg_match($r, $url,$out);
return $out;
}
$array = array('wen.su','wen9.com','wen9.net','wen9.org','dum.su','fiz.su','hak.su','kan.su','koz.su','muk.su','nab.su','puz.su','tep.su','zat.su','kmh.ru');
$url = 'vasya.wen.su'; //site url
$url = parseUrl($url);
if(in_array($url['domain'].$url['extension'], $array))
{
print 'Denied';
}else{
print 'Allow';
}
?>