PHP code example of mooti / validator

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

    

mooti / validator example snippets



    es = [
        'name' => [
            'name'        => 'Name',
            ''length' => [1,null]
            ]
        ],
        'age' => [
            'name'        => 'Age',
            '   'nstraints' => [
                        'length' => [1,null]
                    ]
                ],
                'line2' => [
                    '      'age'  => 102,
        'address' => [
            'line1'    => 'test 1',
            'line2'    => 'test 2',
            'postCode' => 'BR12 2NN',
        ],
        'nickNames' => ['Len Kalobo', 'Kenny McKenface']
    ];

    $validator = new Mooti\Validator\Validator;

    if ($validator->isValid($rules, $data) == false) {
        print_r($validator->getErrors());
    }