1. Go to this page and download the library: Download renanhangai/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/ */
renanhangai / validator example snippets
use libweb\Validator as v;
// Data to be validated
$data = array(
"name" => "John Doe",
"age" => "45",
);
// Validate the data against the rule
$data = v::validate( $data, array(
"name" => v::s(), //< String validator
"age" => v::i(), //< Integer validator
"address?" => v::s(), //< Optional string validator
));
$data->name === "John Doe";
$data->age === 45;
$data->address === null;