用PHP解析电子邮件地址?

this question类似,我如何解析这种格式的电子邮件地址,

"Bob Smith" <bob@company.com>, joe@company.com, "John Doe"<john@company.com>

得到这样的结果:

array(
    'bob@company.com'=>'Bob Smith'
    'joe@company.com'=>''
    'john@company.com'=>'John Doe'
);
好吧,你可以使用mailparse_rfc822_parse_addresses(),就是这样.它是PECL扩展,因此可能更容易使用评论中提到的Mail_RFC822::parseAddressList().
https://stackoverflow.com/questions/7599346/parse-e-mail-addresses-with-php

转载注明原文:用PHP解析电子邮件地址?