kozz / email-address-parser
Simply parses and autocompletes email addresses
Installs: 18 047
Dependents: 0
Suggesters: 0
Security: 0
Stars: 12
Watchers: 2
Forks: 1
Open Issues: 0
Requires
- php: >=5.4.0
- kozz/collection: *
Requires (Dev)
- phpunit/phpunit: ~4.0
- satooshi/php-coveralls: dev-master
Suggests
- php: >=5.5.15
This package is not auto-updated.
Last update: 2024-11-19 01:53:39 UTC
README
Library that allows you simply parse your email addresses from string or array and autocomplete domain name if needed.
Installation
Add the package to your composer.json
and run composer update
.
{
"require": {
"kozz/email-address-parser": "*"
}
}
Examples
Parse String
use Kozz\Components\Email\AddressParser; $emails = 'example0@gmail.com , example1@gmail.com example2@gmail.com'; $array = AddressParser::parse($emails)->toArray(); //$array = ['example0@gmail.com','example1@gmail.com', 'example2@gmail.com']
Autocomplete domain
use Kozz\Components\Email\AddressParser; $emails = 'john@, aaron@, no-reply@gmail.com'; $array = AddressParser::parse($emails, 'company.com')->toArray(); //$array = ['john@company.com', 'aaron@company.com', 'no-reply@gmail.com']
Built-in email validation
use Kozz\Components\Email\AddressParser; $emails = 'john@, no-reply@gmail.com, ... skjs sljfasfn afs, jhsldf.sdfjk"""85;@#$ '; $array = AddressParser::parse($emails, 'company.com')->toArray(); //$array = ['john@company.com', 'no-reply@gmail.com']