]> scripts.mit.edu Git - autoinstalls/mediawiki.git/blob - vendor/pear/mail/tests/validateQuotedString.php
MediaWiki 1.30.2
[autoinstalls/mediawiki.git] / vendor / pear / mail / tests / validateQuotedString.php
1 <?php
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";
6
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");
10 }
11
12 foreach ($address_array as $val) {
13     echo "mailbox : " . $val->mailbox . "\n";
14     echo "host    : " . $val->host . "\n";
15     echo "personal: " . $val->personal . "\n";
16 }
17 print_r($address_array);