如何从逗号分隔的显示名称和电子邮件地址检查电子邮件地址是否有效?

时间:2012-08-12 12:52:29

标签: jquery

如何从逗号分隔的显示名称和电子邮件地址检查电子邮件地址是否有效......

"a1 b.d"<a1@test.com>,  // this is valid
<a2@test.com>,   // this is valid
"a3 b.d"<a3@test.com> , // this is valid
a b.c a4@test.com ,   // this is not valid
"a1 b.d"<a1@test.com>,  // this is valid
<a2test.com>,   // this is not valid
"a3 b.d"<a3@testcom> , // this is not valid
" a b.c a4@test.com " ,   // this is not valid

如果整体有效吗?怎么检查?

1 个答案:

答案 0 :(得分:0)

创建一个包含所有电子邮件的数组,然后在循环时验证。检查列表语言结构。 http://php.net/manual/en/function.list.php