$domains = array(
'meinehochschule.de',
'stud.meinehochschule.de',
'example.net',
);
if(isset($_POST['user_email'])) {
$domain = explode('@', strtolower($_POST['user_email']), 2);
if(count($domain) != 2 || !in_array($domain[1], $domains)) {
$errors[] = 'You are not allowed to register with that email';
}
}