/**
     * 验证密码
     * @param $password
     * @return bool
     */
    public static function checkPassword($password)
    {
        //$search = '/^[-_a-zA-Z0-9]{6,20}$/';
        //密码至少8位,包括数字、大小写字母和特殊字符三种及以上
        $search = '/^(?![A-Za-z]+$)(?![A-Z\d]+$)(?![A-Z\W]+$)(?![a-z\d]+$)(?![a-z\W]+$)(?![\d\W]+$)\S{8,20}$/';
        if (preg_match($search, $password)) {
            return true;
        } else {
            return false;
        }
    }

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-13
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-04
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案