PHP code example of falgunphp / validation
1. Go to this page and download the library: Download falgunphp/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/ */
falgunphp / validation example snippets
use Falgun\Validation\Validator;
$validation = new Validator();
$validation->select('name')->es
$formData = ['name' => 'John Doe', 'email' => '[email protected]'];
$isValid = $validation->validate($formData);
// $isValid will be either true or false
// If validation fails we can get errors
$errors = $validation->errors()->all();
/**
* Example:
* array (
* 'name' => array (
* 'Required' => 'Name is
use Falgun\Http\Session;
use Falgun\Validation\Validator;
// Build Notification Object
$notification = new Notification(new Session(), BootstrapNote::class);
// pass $notification to Validator
$validation = new Validator($notification);
$validation->select('name')-> [icon:protected] => exclamation-triangle
* [message:protected] => Name is