PHP code example of rezozero / canonical-email

1. Go to this page and download the library: Download rezozero/canonical-email 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/ */

    

rezozero / canonical-email example snippets


use RZ\CanonicalEmail\EmailCanonizer;
use RZ\CanonicalEmail\Strategy\GmailStrategy;
use RZ\CanonicalEmail\Strategy\GSuiteStrategy;
use RZ\CanonicalEmail\Strategy\LowercaseDomainStrategy;
use RZ\CanonicalEmail\Strategy\OutlookStrategy;

$canonizer = new EmailCanonizer([
    new LowercaseDomainStrategy(),
    new GmailStrategy(),
    new GSuiteStrategy(),
    new OutlookStrategy()
]);

$canonizer->getCanonicalEmailAddress($email);