2 require_once '../Mail/RFC822.php';
3 $address_string = '"Joe Doe \(from Somewhere\)" <doe@example.com>, postmaster@example.com, root';
4 // $address_string = "Joe Doe from Somewhere <doe@example.com>, postmaster@example.com, root";
5 echo $address_string . "\n";
7 $address_array = Mail_RFC822::parseAddressList($address_string, "example.com");
8 if (!is_array($address_array) || count($address_array) < 1) {
9 die("something is wrong\n");
12 foreach ($address_array as $val) {
13 echo "mailbox : " . $val->mailbox . "\n";
14 echo "host : " . $val->host . "\n";
15 echo "personal: " . $val->personal . "\n";
17 print_r($address_array);