Skip to content

A type validate & filter plugin for php projects.

License

Notifications You must be signed in to change notification settings

taobig/php-filter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This project has been abandoned.

php-filter

A type validate & filter plugin for PHP projects

Latest Stable Version Latest Unstable Version Total Downloads License Build Status Coverage Status

INSTALLATION

Install via Composer
If you do not have Composer, you may install it refer to getcomposer.org.

You can then install this project template using the following command:

php composer.phar require taobig/php-filter

Usage

use taobig\filter\filters\TypeValidator;
TypeValidator::isString("hello world");//return true
TypeValidator::isString(1111.32333, false);//return true
TypeValidator::isInt(1111);//return true
TypeValidator::isInt("1111", false);//return true
TypeValidator::isIntList([1111]);//return true
TypeValidator::isIntList(["1111"], false);//return true
TypeValidator::isStringList(["1111"]);//return true
TypeValidator::isStringList([1111], false);//return true


$filter = new taobig\filter\filters\TypeFilter(['exceptionMessage'=>'parameters type error']);
$filter->stringVal("hello world");//return "hello world"
$filter->stringVal(1111.32333, false);//return "1111.32333"
$filter->intVal("1111", false);//return 1111

use taobig\filter\filters\MobileValidator;  
TypeValidator::isChineseMobile("13800001111");//return true

About

A type validate & filter plugin for php projects.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages