PHP code example of olssonm / email-address
1. Go to this page and download the library: Download olssonm/email-address library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
olssonm / email-address example snippets
php
use Olssonm\EmailAddress\EmailAddress;
// Returns a `Olssonm\EmailAddress\Entity\EmailAddress`-instance
$email = EmailAddress::parse('[email protected]');
echo $email->address;
// [email protected]
echo $email->local;
// test+tag
echo $email->delivery;
// test
echo $email->tag;
// tag
echo $email->domain;
// example.com
php
$email = EmailAddress::build()
->address('[email protected]')
->tag(null)
->get()
echo $email->address;
// [email protected]
php
$email = EmailAddress::build()
->address('[email protected]')
->tag('mytag')
->get()
echo $email->address;
// [email protected]