array parseAddressList (
string $address = ''
string $defaultDomain = 'localhost'
Extracts the given addresses into their parts.
string $address - the address(es) to validate
string $defaultDomain - the default domain to use in case of absence in the given email address.
boolean $nestGroups - whether to return the structure with groups nested for easier viewing.
boolean $validate - whether to validate atoms. Turn this off if you need to run addresses through before encoding the personal names, for instance.
array - a nested array of anonymous objects.
If $nestGroups set to FALSE, you can jump over the next paragraph.
Every array entry contains an object per group. This object has two attributes:
The addresses array consists of an array of anonymous objects for each address. This object comes with the following attributes:
|Error code||Error message||Reason||Solution|
|NULL||every||The given address string is not RFC822 compliant||The error code contains a description of the error.|
This function can be called statically.
Extract some addresses
$address = 'My group: "Richard" <richard@localhost>;, email@example.com (A comment)';
$addresses = Mail_RFC822::parseAddressList($address, 'phpguru.org', TRUE);