Elgg  Version 2.3
Address.php
Go to the documentation of this file.
1 <?php
2 namespace Elgg\Mail;
3 
9 class Address {
19  public static function fromString($contact) {
20  $containsName = preg_match('/<(.*)>/', $contact, $matches) == 1;
21  if ($containsName) {
22  $name = trim(substr($contact, 0, strpos($contact, '<')));
23  return new \Zend\Mail\Address($matches[1], $name);
24  } else {
25  return new \Zend\Mail\Address(trim($contact));
26  }
27  }
28 }
if($guid==elgg_get_logged_in_user_guid()) $name
Definition: delete.php:21
static fromString($contact)
Parses strings like "Evan <evan@elgg.org>" into name/email objects.
Definition: Address.php:19
TODO(ewinslow): Contribute something like this back to Zend project.
Definition: Address.php:9