mirror of
https://github.com/egulias/EmailValidator.git
synced 2026-08-28 19:19:31 +00:00
Merge pull request #26 from stof/patch-1
Fixed the SensioLabsInsight project id
This commit is contained in:
@@ -1,51 +1,51 @@
|
||||
EmailValidator [](https://travis-ci.org/egulias/EmailValidator) [](https://coveralls.io/r/egulias/EmailValidator?branch=master) [](https://insight.sensiolabs.com/projects/b18d473e-bd5a-4d88-a7b2-7aeaee0ebd7b)[](https://scrutinizer-ci.com/g/egulias/EmailValidator/?branch=master)
|
||||
=============================
|
||||
|
||||
##Installation##
|
||||
Install via composer. Add to your current composer.json ```require``` key: ```"egulias/email-validator":"~1.0" ```
|
||||
|
||||
##Usage##
|
||||
|
||||
Simple example:
|
||||
|
||||
```php
|
||||
<?php
|
||||
|
||||
use Egulias\EmailValidator\EmailValidator;
|
||||
|
||||
$validator = new EmailValidator;
|
||||
if ($validator->isValid($email)) {
|
||||
echo $email . ' is a valid email address';
|
||||
}
|
||||
```
|
||||
|
||||
More advanced example (returns detailed diagnostic error codes):
|
||||
|
||||
```php
|
||||
<?php
|
||||
|
||||
use egulias\EmailValidator\EmailValidator;
|
||||
|
||||
$validator = new EmailValidator;
|
||||
$email = 'dominic@sayers.cc';
|
||||
$result = $validator->isValid($email);
|
||||
|
||||
if ($result) {
|
||||
echo $email . ' is a valid email address';
|
||||
} else if ($validator->hasWarnings()) {
|
||||
echo 'Warning! ' . $email . ' has unusual/deprecated features (result code ' . var_export($validator->getWarnings(), true) . ')';
|
||||
} else {
|
||||
echo $email . ' is not a valid email address (result code ' . $validator->getError() . ')';
|
||||
}
|
||||
```
|
||||
|
||||
##Contributors##
|
||||
As this is a port from another library and work, here are other people related to the previous:
|
||||
|
||||
* Ricard Clau [@ricardclau](http://github.com/ricardclau): Performance against PHP built-in filter_var
|
||||
* Josepf Bielawski [@stloyd](http://github.com/stloyd): For its first re-work of Dominic's lib
|
||||
* Dominic Sayers [@dominicsayers](http://github.com/dominicsayers): The original isemail function
|
||||
|
||||
##License##
|
||||
Released under the MIT License attached with this code.
|
||||
|
||||
EmailValidator [](https://travis-ci.org/egulias/EmailValidator) [](https://coveralls.io/r/egulias/EmailValidator?branch=master) [](https://insight.sensiolabs.com/projects/22ba6692-9c02-42e5-a65d-1c5696bfffc6)[](https://scrutinizer-ci.com/g/egulias/EmailValidator/?branch=master)
|
||||
=============================
|
||||
|
||||
##Installation##
|
||||
Install via composer. Add to your current composer.json ```require``` key: ```"egulias/email-validator":"~1.0" ```
|
||||
|
||||
##Usage##
|
||||
|
||||
Simple example:
|
||||
|
||||
```php
|
||||
<?php
|
||||
|
||||
use Egulias\EmailValidator\EmailValidator;
|
||||
|
||||
$validator = new EmailValidator;
|
||||
if ($validator->isValid($email)) {
|
||||
echo $email . ' is a valid email address';
|
||||
}
|
||||
```
|
||||
|
||||
More advanced example (returns detailed diagnostic error codes):
|
||||
|
||||
```php
|
||||
<?php
|
||||
|
||||
use egulias\EmailValidator\EmailValidator;
|
||||
|
||||
$validator = new EmailValidator;
|
||||
$email = 'dominic@sayers.cc';
|
||||
$result = $validator->isValid($email);
|
||||
|
||||
if ($result) {
|
||||
echo $email . ' is a valid email address';
|
||||
} else if ($validator->hasWarnings()) {
|
||||
echo 'Warning! ' . $email . ' has unusual/deprecated features (result code ' . var_export($validator->getWarnings(), true) . ')';
|
||||
} else {
|
||||
echo $email . ' is not a valid email address (result code ' . $validator->getError() . ')';
|
||||
}
|
||||
```
|
||||
|
||||
##Contributors##
|
||||
As this is a port from another library and work, here are other people related to the previous:
|
||||
|
||||
* Ricard Clau [@ricardclau](http://github.com/ricardclau): Performance against PHP built-in filter_var
|
||||
* Josepf Bielawski [@stloyd](http://github.com/stloyd): For its first re-work of Dominic's lib
|
||||
* Dominic Sayers [@dominicsayers](http://github.com/dominicsayers): The original isemail function
|
||||
|
||||
##License##
|
||||
Released under the MIT License attached with this code.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user