1. Go to this page and download the library: Download overtrue/validation 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/ */
overtrue / validation example snippets
use Overtrue\Validation\Translator;
use Overtrue\Validation\Factory as ValidatorFactory;
//初始化工厂对象
$factory = new ValidatorFactory(new Translator);
//验证
$rules = [
'username' => ' print_r($validator->messages()->all()); // 或者 $validator->errors();
}