\Charcoal\EmailEmailAwareTrait

For objects that are or interact with emails.

Summary

Methods
Properties
Constants
No public methods found
No public properties found
No constants found
emailToArray()
emailFromArray()
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

emailToArray()

emailToArray(mixed  $var) : string

Convert an email address (RFC822) into a proper array notation.

Parameters

mixed $var

An email array (containing an "email" key and optionally a "name" key).

Throws

\InvalidArgumentException

If the email is invalid.

Returns

string

emailFromArray()

emailFromArray(array  $arr) : string

Convert an email address array to a RFC-822 string notation.

Parameters

array $arr

An email array (containing an "email" key and optionally a "name" key).

Throws

\InvalidArgumentException

If the email array is invalid.

Returns

string