1. Go to this page and download the library: Download memcrab/validator library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
memcrab / validator example snippets
use Memcrab\Validator\Validator;
use Respect\Validation\Validator as v;
class Auth extends Validator
{
public function authorization()
{
$this
->addBodyRule('email', v::email(), 'Email not valid', 400101)
->addBodyRule('password', v::length(8, 100), 'Password should be more than 8 symbols', 400102);
}
}