mysql - How do I check if a password has at least one number in it using PHP -
i learning @ moment php & mysql please excuse me if question silly. trying create simple login/registration system based on php , mysql.
my idea check if password has number in , if doesn't give error message. problem if include number in password still gives error. if can me grateful. thank in advance.
my code is:
if(!preg_match('/^[0-9]*$/',$_post['password'])){ die('password must contain @ least 1 number.'); }
best regards,
george stoqnov
the * means 0 or more need +
'/[0-9]+/'
and remove ^$ because means has start , end expression
Comments
Post a Comment