PHP code example of mouyong / validate

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

    

mouyong / validate example snippets


./webman plugin:install mouyong/validate

or

php ./vendor/mouyong/validate/src/scripts/install.php

./webman plugin:uninstall mouyong/validate

or

php ./vendor/mouyong/validate/src/scripts/uninstall.php

$data = [
    'name'  => 'Tinywan',
    'age'  => 24,
    'email' => '[email protected]'
];


/** @var \Illuminate\Contracts\Validation\Validator|\Illuminate\Contracts\Validation\Factory $validator */
$validator = validator($data, [
    'name'  => '   => '年龄必须是数字',
    'age.between'  => '年龄只能在1-120之间',
    'email.