PHP Classes

PHP Validation: Validate request values according to given rules

Recommend this page to a friend!
  Info   View files Example   View files View files (9)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not yet rated by the usersTotal: 125 All time: 9,402 This week: 107Up
Version License PHP version Categories
php-validation 1.0.0MIT/X Consortium ...5PHP 5, Validation
Description 

Author

This package can validate request values according to given rules.

It can take as parameters an array with request values and an array of rules to apply to the values to be validated.

The package can validate the values and can return a list of errors in case at least of the values is invalid.

Picture of Muhammad Umer Farooq
Name: Muhammad Umer Farooq is available for providing paid consulting. Contact Muhammad Umer Farooq .
Classes: 52 packages by
Country: Pakistan Pakistan
Age: 22
All time rank: 84711 in Pakistan Pakistan
Week rank: 91 Up3 in Pakistan Pakistan Up
Innovation award
Innovation award
Nominee: 6x

Example

<?php

   
require __DIR__.'/vendor/autoload.php';
   
   
$rules = [
       
'username' => ['required' => true, ],
       
'email' => ['required' => true],
       
'password' => ['required' => true, ],
    ];
   
$validation = new Validation($_POST,$rules,'input');
    if(
$validation->fail()){
       
$errors = $validation->error()->get();

        foreach (
$errors as $error) {
            foreach (
$error as $value) {
                echo
$value."<br>";
            }
        }
    } else {
       
//TO-Do create the user
   
}


  Files folder image Files  
File Role Description
Files folder imageexample (1 file)
Files folder imagesrc (5 files)
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file LICENSE Lic. License text
Accessible without login Plain text file readme.md Doc. Read me

  Files folder image Files  /  example  
File Role Description
  Accessible without login Plain text file index.php Example Example script

  Files folder image Files  /  src  
File Role Description
  Plain text file Handler.php Class Class source
  Plain text file InputRules.php Class Class source
  Plain text file JsonRules.php Class Class source
  Plain text file StickyRules.php Class Class source
  Plain text file Validation.php Class Class source

 Version Control Unique User Downloads Download Rankings  
 100%
Total:125
This week:0
All time:9,402
This week:107Up