BaseValidate.php 458 字节
<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2020/6/28
 * Time: 18:22
 */

namespace app\common\validate;


use think\Validate;

class BaseValidate extends Validate
{
    /**
     * 验证手机号是否正确
     * @param $value
     * @param $rule
     * @param $data
     */
    protected function checkPhone($value, $rule, $data)
    {
        return preg_match("/^1[3456789]\d{9}$/", $value) ? true : "手机号不正确";
    }

}