PHP code example of bileji / validator

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

    

bileji / validator example snippets


$validator = new \Bileji\Validator\Validator();

$validator->execute([
    "fruit" => "apple",
    "attribute" => [
        [
            "price" => 5,
            "time" => "2016-03-14 12:00:00"
        ],
        [
            "price" => 4,
            "time" => "2016-03-15 12:00:00"
        ]
    ],
    "email" => "[email protected]",
    "colors" => ["color1" => "red", "color2" => "green"]
], [
    "fruit" => "     ["time"]=>
      string(19) "2016-03-14 12:00:00"
    }
    [1]=>
    array(2) {
      ["price"]=>
      string(1) "4"
      ["time"]=>
      string(19) "2016-03-15 12:00:00"
    }
  }
  ["email"]=>
  string(17) "[email protected]"
  ["colors"]=>
  array(2) {
    ["color1"]=>
    string(3) "red"
    ["color2"]=>
    string(5) "green"
  }
}

$validator->withMessage([
    'fruit|,
    "attribute" => [
        [
            "price" => 5,
            "time" => "2016-03-14 12:00:00"
        ],
        [
            "price" => 4,
            "time" => "2016-03-15 12:00:00"
        ]
    ],
    "email" => "[email protected]",
    "colors" => ["color1" => "red", "color2" => "green"]
], [
    "fruit" => "