PHP code example of lithemod / validator

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

    

lithemod / validator example snippets




use Lithe\Base\Validator;

$data = [
    'email' => '[email protected]',
    'name' => 'John Doe',
    'age' => '25',
];

$rules = [
    'email' => '

if ($validator->passed()) {
    echo "Validation passed!";
} else {
    echo "Validation failed!";
    print_r($validator->errors());
}

$data = [
    'email' => '[email protected]',
    'name' => 'Alice',
    'age' => '30',
];

$rules = [
    'email' => 'rules);

if ($validator->passed()) {
    echo "All validations passed!";
} else {
    echo "There were validation errors:";
    print_r($validator->errors());
}