PHP code example of amitkhare / easy-validation

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

    

amitkhare / easy-validation example snippets

sh


w AmitKhare\EasyValidation\EasyValidation(); // instantiate EasyValidation;

$v->setSource($_POST); // set data source array;

$v->setLocale("en-IN","PATH/TO/LOCALES/DIRECTORY/"); 
    
$v->check("email","
sh

use AmitKhare\EasyValidation; // use namespace.

n;

//  OR with database for unique field check
$v = new EasyValidation($host,$username,$password,$dbname); // instantiate EasyValidation With Database features;

$v->setSource($_POST); // set data source array;


// check bottom of this file for sample en-IN.lang file
$v->setLocale("en-IN","PATH/TO/LOCALES/DIRECTORY/"); 
    
$v->check("mobile","