PHP Classes

File: readme.md

Recommend this page to a friend!
  Classes of Muhammad Umer Farooq   PHP Validation   readme.md   Download  
File: readme.md
Role: Documentation
Content type: text/markdown
Description: Read me
Class: PHP Validation
Validate request values according to given rules
Author: By
Last change:
Date: 6 years ago
Size: 604 bytes
 

Contents

Class file image Download

PHP validation

Requirement

  • PHP
  • Composer

install

run this command


## usage

<?php

require __DIR__.'/vendor/autoload.php'; 

$rules = [
	'username' => ['required' => true, ],
	'email' => ['required' => true],
	'password' => ['required' => true, ],
];
$validation = new \Lablnet\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
}