1. Go to this page and download the library: Download nanaksr/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/ */
nanaksr / validator example snippets
use nanaksr\validator\validation as vldtn;
$params = []; //From your HTML Form parameters
$vldtn = new vldtn('id');
$vldtn->params($params);
$vldtn->setParamKey('nama_lengkap')->setName('Nama Lengkap')->setRule('ValidateFullName');//validate existing rules
$vldtn->setParamKey('email')->setName('Alamat Email')->setRule('ValidateEmail');//validate existing rules
$vldtn->setParamKey('bank_option')->setName('Bank Tujuan')->setRule(['BCA','BNI','BRI','MANDIRI']); //option value
$vldtn->setParamKey('customs')->setName('Custom Regex')->setRule('/^(your_regex_pattern)$/'); //custom regex pattern
$vldtn->setParamKey('password')->setName('Buat Password')->setRule('ValidateAlnum'); //Alpha, Numeric, and keyboard character
$vldtn->setParamKey('re_password')->setName('Konfirmasi Password')->equal('password'); //equal param, usually for password
$vldtn->unsetParamKey('email');//if you don't want to be displayed some param
if($vldtn->hasError()){
print_r($vldtn->getErrors())
}
$fields = $vldtn->getResults();
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.