Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/plsankar/php-validateit
A Simple Validation Class for PHP
https://github.com/plsankar/php-validateit
Last synced: about 1 month ago
JSON representation
A Simple Validation Class for PHP
- Host: GitHub
- URL: https://github.com/plsankar/php-validateit
- Owner: plsankar
- License: mit
- Created: 2020-09-11T16:11:26.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-09-11T18:00:56.000Z (over 4 years ago)
- Last Synced: 2024-04-20T05:00:47.066Z (8 months ago)
- Language: PHP
- Homepage:
- Size: 2.93 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ValidateIt
A Simple Validation Class for PHP
## Install
Via composer
```bash
$ composer require plsankar/validateit:1.0
```## Usage
```php
use \plsankar\ValidateIt\ValidateIt;$data = array(
"name" => "Some Guy",
"email" => "[email protected]",
"phone" => "1234567890",
"role" => "1",
"address" => "In 3rd Planet",
"zipcode" => "000000"
);$rules = [
"name",
"email:EMAIL",
"phone:PHONE",
"role:INT"
];ValidateIt::isValid($data, $rules) // true or false
echo "isvalid: " . (ValidateIt::isValid($data, $rules) ? "ok" : "not");
```