2014-10-19 24 views

回答

2
$allowed_domains = array("ourcompany.com"); 
$email_domain = array_pop(explode("@", $email)); 
if(!in_array($email_domain, $allowed_domains)) { 
    // Not an authorised email 
} 

它只是。为允许的域创建一个数组,使其爆炸@,获取数组的最后一个元素,并检查它是否存在于允许的域数组中。

+0

可以请你告诉我,我怎么把这个代码:http://pastebin.com/0aJZfHWx 我是一个有点noob :( – 2014-10-19 19:23:06

+0

你想你的枕头蓬松吗? – 2014-10-19 19:29:20

+0

不,我可以做到这一点。我只为我无法做到的事情寻求帮助,但无论如何,谢谢(Y) – 2014-10-19 19:34:06

相关问题