if I understood you right, you could do:
$restr_domains = array(
"hotmail.com",
"gmx.net",
"fake.uk"
);
// e.g. mail == someone@hotmail.com
// domain is the second part of the mail address, split by "@".
$mailparts = explode("@", $mail);
$domain = $mailparts[1];
if(in_array($restr_domains, $domain))
{
echo "Sorry, we don't accept that domain.";
}
else
{
// process input ...
}
note that the restr_domains array could come from a file as well:
$restr_domains = file("restricted.txt");
in this case you must strip off the line delimiters of each entry:
for($i=0; $i<count($restr_domains); $i++)
$restr_domains[$i] = trim($restr_domains[$i]);
and now the in_array check would work.