PHP code example of imliam / php-unique-gmail-address

1. Go to this page and download the library: Download imliam/php-unique-gmail-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/ */

    

imliam / php-unique-gmail-address example snippets


$email = new UniqueGmailAddress('[email protected]');
$email->normalizeAddress(); // [email protected]

$email = new UniqueGmailAddress('[email protected]');
$email->getRegex(); // ^e(\.?)+x(\.?)+a(\.?)+m(\.?)+p(\.?)+l(\.?)+e(\+.*)?\@(gmail|googlemail).com$

$email = new UniqueGmailAddress('[email protected]');
$email->matches('[email protected]'); // true

$request->validate([
    'email' => [new UniqueGmailAddressRule()],
]);

$request->validate([
    'email' => [new UniqueGmailAddressRule('contacts', 'email_address')],
]);
bash
composer 
 php
$email = new UniqueGmailAddress('[email protected]');