A php package for validation.
Install via composer
composer require atakde/php-validation
require 'vendor/autoload.php';
use Atakde\PhpValidation\Validator;
$params = [
'username' => 'TestUsername',
'email' => '[email protected]',
'password' => '123'
];
$validateRules = [
'email' => 'required|email',
'username' => 'required|string|min:5|max:10',
'password' => 'required|password'
];
$validator = new Validator();
$validator->validate($validateRules, $params);
var_dump($validator->fails());
var_dump($validator->getErrors());