PHP code example of jincon / aiivalidator

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

    

jincon / aiivalidator example snippets


$data = ['title'=>'你', 'email'=>'1@baiducom'];
$rules = [
  'title' => 'AiiValidator($data, $rules);

//$validator = new \Jincon\AiiValidator\AiiValidator($data, $rules,'en');

if ( !$validator->success ) {
  foreach ($validator->errors as $error) {
    echo $error.'<br>';
  }
}