PHP code example of jliu / helper
1. Go to this page and download the library: Download jliu/helper library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
jliu / helper example snippets
// 是否为手机号
isMobile('18888888888');
// 随机数
random($length, $numeric = false)
// 字符串截取,支持中文和其他编码
msubstr($str, $start, $length, $charset = "utf-8", $suffix = true)
// 验证手机号是否正确
Validate::isMobile($text)
// 验证密码是否正确
Validate::isPassword($password)
// 验证邮箱是否正确
Validate::isEmail($mail)
// 验证用户名是否正确
Validate::isUserName($username)
// 验证身份证号码格式是否正确
Validate::isIdCard($id_card)