$blacklist = array('gmail', 'gmx', 'hotmail');
$post = $_POST['check'];
$found = false;
foreach ($blacklist as $entry) {
if (preg_match('/' . $entry . '/', $post)) {
$found = true;
}
}
if (empty($post)) {
echo 'Type email (eg. dude@gmail.com)';
} else {
if ($found) {
echo $post . ' is blacklisted';
} else {
echo $post . ' is not blacklisted';
}
}