function check_domain ($url, $white_list, $black_list
{
foreach ($white_list as $re) {
$re = preg_quote$re);
$re = str_replace'*', '.*', $re);
if (preg_match'|^'$re'$|', $url)) {
return true;
}
}
foreach ($black_list as $re) {
$re = preg_quote$re);
$re = str_replace'*', '.*', $re);
if (preg_match'|^'$re'$|', $url)) {
return false;
}
}
return true;
}
eXorithm – Execute Algorithm: View / Run Algorithm check_domain
