Gogs 1ec4058aa2 Initial configuration | %!s(int64=7) %!d(string=před) roky | |
---|---|---|
.. | ||
src | %!s(int64=7) %!d(string=před) roky | |
.coveralls.yml | %!s(int64=7) %!d(string=před) roky | |
.gitignore | %!s(int64=7) %!d(string=před) roky | |
.travis.yml | %!s(int64=7) %!d(string=před) roky | |
LICENSE | %!s(int64=7) %!d(string=před) roky | |
README.md | %!s(int64=7) %!d(string=před) roky | |
composer.json | %!s(int64=7) %!d(string=před) roky | |
composer.lock | %!s(int64=7) %!d(string=před) roky | |
phpunit.xml.dist | %!s(int64=7) %!d(string=před) roky |
#EmailValidator
With the help of
Run the command below to install via Composer
composer require egulias/email-validator "~1.2"
##Usage##
Simple example:
<?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
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:
##License## Released under the MIT License attached with this code.