zoukankan      html  css  js  c++  java
  • PHP 判断密码强度

     
               $score = 0;
               if(preg_match("/[0-9]+/",$str))
               {
                  $score ++; 
               }
               if(preg_match("/[0-9]{3,}/",$str))
               {
                  $score ++; 
               }
               if(preg_match("/[a-z]+/",$str))
               {
                  $score ++; 
               }
               if(preg_match("/[a-z]{3,}/",$str))
               {
                  $score ++; 
               }
               if(preg_match("/[A-Z]+/",$str))
               {
                  $score ++; 
               }
               if(preg_match("/[A-Z]{3,}/",$str))
               {
                  $score ++; 
               }
               if(preg_match("/[_|-|+|=|*|!|@|#|$|%|^|&|(|)]+/",$str))
               {
                  $score += 2; 
               }
               if(preg_match("/[_|-|+|=|*|!|@|#|$|%|^|&|(|)]{3,}/",$str))
               {
                  $score ++ ; 
               }
               if(strlen($str) >= 10)
               {
                  $score ++; 
               }
               echo "<br>";
               echo $score;
  • 相关阅读:
    Struts的ONGL
    深度解析 Qt 中动态链接库
    QTcpSocket 发送数据的几种方法
    QT GUI总结
    Qt 插件学习(一)
    Qt自定义窗口部件
    Qt事件机制浅析
    VS2008 Qt Designer 中自定义信号槽
    Q窗口操作函数(窗口最大化,全屏,隐藏最大化最小化按钮)
    QT中窗口刷新事件的学习总结
  • 原文地址:https://www.cnblogs.com/caorui-log/p/10711487.html
Copyright © 2011-2022 走看看