tleckie / validator
PHP validator (bool, int, float, number, string, email, uri)
Fund package maintenance!
teodoroleckie
www.paypal.com/donate?business=ZHYA2MTGA4884¤cy_code=USD
Requires
- php: ^8
Requires (Dev)
- infection/infection: ^0.21.5
- phpunit/phpunit: ^9.5
README
Installation
You can install the package via composer:
composer require tleckie/validator
<?php require "vendor/autoload.php"; use Tleckie\Validator\ValidatorFactory; $validator = new ValidatorFactory(); $validator->boolValidator()->isValid('true'); // false $validator->emailValidator()->isValid('email@gmail.com'); // true $validator->floatValidator()->isValid(1.22); // true $validator->intValidator()->isValid(1.22); // false $validator->numericValidator()->isValid(1.22); // true $validator->stringValidator()->isValid("1.22"); // true $validator->uriValidator()->isValid("https://hostname.dev/path/"); // true