Gle*_*aya 13 php security passwords
我想检查用户是否已成功满足以下要求:
我该怎么做?
我正在使用下面的PHP脚本:
if ( strlen( $password ) < 8 ) { false } else { if ( preg_match( "/[^0,9]/", $password ) ) { // how to check the upper case and lower case } }
Joh*_*nde 9
你可以用正则表达式做到这一点:
if (!preg_match('/^(?=[a-z])(?=[A-Z])[a-zA-Z]{8,}$/', $password)) { //error }
And*_*per 4
使用preg_match("/[A-Z]/")和preg_match("/[a-z]/")
preg_match("/[A-Z]/")
preg_match("/[a-z]/")
归档时间:
14 年,8 月 前
查看次数:
8713 次
最近记录:
11 年,9 月 前