Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
urakozz committed Aug 6, 2014
1 parent ecb4b1a commit 2e69af9
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ PHP Email Address Parser
[![Latest Unstable Version](https://poser.pugx.org/kozz/email-address-parser/v/unstable.svg)](https://packagist.org/packages/kozz/email-address-parser)
[![License](http://img.shields.io/packagist/l/kozz/email-address-parser.svg)](https://packagist.org/packages/kozz/email-address-parser)

Library that allows you simply parse your email addresses from string or array and autocomplete domain name if needed.

Installation
------------

Expand All @@ -18,3 +20,30 @@ Add the package to your `composer.json` and run `composer update`.
"kozz/email-address-parser": "*"
}
}

Examples
--------

#### Parse String

```php
$emails = '[email protected] , [email protected] [email protected]';
$array = AddressParser::parse($emails)->toArray();
//$array = ['[email protected]','[email protected]', '[email protected]']
```

#### Autocomplete domain

```php
$emails = 'john@, aaron@, [email protected]';
$array = AddressParser::parse($emails, 'company.com')->toArray();
//$array = ['[email protected]', '[email protected]', '[email protected]']
```

#### Built-in email validation

```php
$emails = 'john@, [email protected], ... skjs sljfasfn afs, jhsldf.sdfjk"""85;@#$ ';
$array = AddressParser::parse($emails, 'company.com')->toArray();
//$array = ['[email protected]', '[email protected]']
```

0 comments on commit 2e69af9

Please sign in to comment.