phossa2/validate is a PHP validation proxy to various validate libraries.
It requires PHP 5.4, supports PHP 7.0+ and HHVM. It is compliant with PSR-1, PSR-2, PSR-3, PSR-4, and the proposed PSR-5.
Install via the composer
utility.
composer require "phossa2/validate"
or add the following lines to your composer.json
{
"require": {
"phossa2/validate": "^2.0.0"
}
}
Create the validate instance,
use Phossa2\Validate\Validate;
$v = new Validate();
if (true === $v->validate($_POST, [
'username' => 'required|alpha_numeric',
'password' => 'required|max_len,100|min_len,6'
])) {
// continue
} else {
$err = $v->getError();
}
Please see CHANGELOG from more information.
$ composer test
Please see CONTRIBUTE for more information.
-
PHP >= 5.4.0
-
phossa2/shared >= 2.0.21
-
wixel/gump >= 1.4