PHP code example of runner / validator

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

    

runner / validator example snippets



use Runner\Validator\Validator;

// 增加规则扩展
Validator::addExtension(
    'channel',
    function ($field, $value, array $parameters = []) {
        return false !== array_search($value, ['google', 'bing']);
    },
    false
);

$data = [
    'blog' => 'https://github.com/RunnerLee',
];
$rule = [
    'blog' => '

$data = [
    'foo' => '',
];

$rules= [
    'foo' => 'string',
];