1. Go to this page and download the library: Download lexuss1979/validol 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/ */
lexuss1979 / validol example snippets
use Lexuss1979\Validol\Validator;
$validation = Validator::process(['name' => 'Olga', 'age' => 18], [
'name' => ';
} else {
// There are errors
var_dump($validation->errors());
}
use Lexuss1979\Validol\Validator;
$validation = Validator::process([], ['age' => '
$validation = Validator::process([ 'age' => 'seventeen' ], ['age' => 'sometimes integer']);
// fails because age must be an integer value if presents