1. Go to this page and download the library: Download shippeo/valitron 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/ */
shippeo / valitron example snippets
$v = new Valitron\Validator(array('name' => 'Chester Tester'));
$v->rule('ors
print_r($v->errors());
}
$v = new Valitron\Validator($_POST);
$v->rule(' {
echo "Yay! We're all good!";
} else {
// Errors
print_r($v->errors());
}
Valitron\Validator::addRule('alwaysFail', function($field, $value, array $params, array $fields) {
return false;
}, 'Everything you do is wrong. You fail.');