if (!preg_match("/[A-Za-z].*[0-9]|[0-9].*[A-Za-z]/",$password)) {
$errors[] = Mage::helper('customer')->__('Password must composed of numbers and letters');
}
本文介绍了一种使用PHP正则表达式检查密码是否同时包含字母和数字的方法。为了确保密码的安全性,该方法会在密码不符合规定时返回错误信息。
if (!preg_match("/[A-Za-z].*[0-9]|[0-9].*[A-Za-z]/",$password)) {
$errors[] = Mage::helper('customer')->__('Password must composed of numbers and letters');
}

被折叠的 条评论
为什么被折叠?