composer require chendujin/validator
require '../vendor/autoload.php';
use DataTrans\Validator;
$mobilephone = '123456';
$res = Validator::is_mobilephone($mobilephone);
var_dump($res);
$email = '123456@qq.com';
$res = Validator::is_email($email);
var_dump($res);
$qq = '123456';
$res = Validator::is_qq($qq);
var_dump($res);
$username = 'Thomas';
$min_len = 3;
$max_len = 9;
$mode = 'mix';
$res = Validator::is_username($username, $min_len, $max_len, $mode);
var_dump($res);
$password = '123456';
$min_len = 3;
$max_len = 9;
$mode = 'mix';
$res = Validator::is_password($password, $min_len, $max_len, $mode = 'mix');
var_dump($res);
$vStr = '1234562354253434';
$res = Validator::is_idcard($vStr);
var_dump($res);
$url = 'http://www.baidu.com';
$res = Validator::is_url($url);
var_dump($res);
$str = '123456asssss';
$res = Validator::is_alpha_number($str);
var_dump($res);