PHP code example of php-woox / webman-validate

1. Go to this page and download the library: Download php-woox/webman-validate 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/ */

    

php-woox / webman-validate example snippets


$data = [
    'name'  => 'codeloving',
    'age'  => 24,
    'email' => '[email protected]'
];
validate($data, \app\index\validate\UserValidate::class);

$validate = \Woox\WebmanValidate\Facade\Validate::rule('age', 'number|between:1,120')
    ->rule([
        'name'  => '$validate->check($data)) {
    var_dump($validate->getError());
}
shell
composer 

namespace app\index\validate;

use Woox\WebmanValidate\Validate;

class UserValidate extends Validate
{
    protected $rule =   [
        'name'  => ' '名称必须',
        'name.max'     => '名称最多不能超过25个字符',
        'age.