$string ='"Test User" <test@test.com>,"Another" <another@test.com>,"aeer" <whateveryourmail@gmail.com>';
I’ve succeed splitting this become pair of name and email address with this code
preg_match_all('!"(.*?)"\s+<\s*(.*?)\s*>!', $string, $matches);
the problem is, I can’t validate the email address,false email address will be match too.
How to filter only valid email and also splitting Name and email address?
You could use some of the available mail address parsers available, e.g.:
mailparse_rfc822_parse_addresses()Mail_RFC822::parseAddressList()Optionally, filter the output through
filter_var()(or one of its permutations targeted at arrays) with theFILTER_VALIDATE_EMAIL.