Simple and fluent input validation for PHP >= 5.3.
<?php
$v = new Filtr\Validator();
$v->required('email')->isNotBlank()->isEmailAddress();
$v->required('password')->isNotBlank()->isHavingLength(8, 32);
$v->key('remember_me')->isTrue();
$result = $v->validate([
'email' => 'contact@vaibhavpandey.com',
'password' => 'not-much-secret',
]);
if ($result->valid()) {
// ... proceed
} else {
echo implode('<br>', $result->errors());
}
Detailed installation and usage instructions can be found in the Wiki.
See LICENSE.md file.