Skip to content

Commit

Permalink
Update example code
Browse files Browse the repository at this point in the history
  • Loading branch information
Konrad Fedorczyk committed Mar 22, 2021
1 parent 11d7b1d commit e849126
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
1 change: 1 addition & 0 deletions examples/addresses.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@
'[email protected]',
'[email protected]',
'[email protected]',
'[email protected]',
];
18 changes: 18 additions & 0 deletions examples/mx.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php

require __DIR__ . '/../vendor/autoload.php';

use Fedek6\TldMailValidator\TldMailValidator;

/** @var string $tldsFilePath */
$tldsFilePath = __DIR__ . '/../data/tlds-alpha-by-domain.txt';

/** @var array $addresses */
$addresses = require __DIR__ . '/addresses.php';

/** @var \Fedek6\TldMailValidator\TldMailValidator $validator */
$validator = new TldMailValidator($tldsFilePath, TldMailValidator::TEST_ALL);

foreach ($addresses as $address) {
echo "Address {$address} is " . ($validator->validate($address) ? 'valid' : 'invalid') . "\n";
}
File renamed without changes.

0 comments on commit e849126

Please sign in to comment.