Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 80dac1b

Browse files
committed
Update readme with installation and usage
1 parent 1ee379e commit 80dac1b

1 file changed

Lines changed: 44 additions & 2 deletions

File tree

README.md

Lines changed: 44 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,47 @@
44

55
PHP library to check if an email comes from a **disposable email provider**.
66

7-
Note: this library is strongly inspired from [FGRibreau/mailchecker](https://github.com/FGRibreau/mailchecker),
8-
except it only focuses on PHP.
7+
Note: this library is inspired from [FGRibreau/mailchecker](https://github.com/FGRibreau/mailchecker),
8+
except it only focuses on PHP.
9+
10+
## Installation
11+
12+
Via [Composer](http://getcomposer.org/):
13+
14+
```
15+
composer require "mattketmo/email-checker:dev-master"
16+
```
17+
18+
## Usage
19+
20+
Basic use of EmailChecker with built-in throwaway email list:
21+
22+
```php
23+
<?php
24+
25+
require __DIR__.'/vendor/autoload.php';
26+
27+
use EmailChecker\EmailChecker;
28+
29+
$checker = new EmailChecker();
30+
31+
$checker->isValid('[email protected]'); // true
32+
$checker->isValid('[email protected]'); // false
33+
```
34+
35+
Or using your another adapter:
36+
37+
```php
38+
<?php
39+
40+
use EmailChecker\EmailChecker;
41+
use EmailChecker\Adapter;
42+
43+
$checker = new EmailChecker(new Adapter\ArrayAdapter(array(
44+
'foo.org',
45+
'baz.net'
46+
)));
47+
48+
$checker->isValid('[email protected]'); // true
49+
$checker->isValid('[email protected]'); // false
50+
```

0 commit comments

Comments
 (0)