Hi,all
I want to ask for the php code to check the password validation?
It couldn't be entire alphabetic or entirely numeric?
Thanks.
shasha821110
0
Junior Poster
Recommended Answers
Jump to PostAre you asking how to check for only numbers in a string? if so is_numeric would do this:
if (is_numeric($password)) { echo "Password is numeric"; } else { echo "Password is not numeric"; }
Or for alpha-numeric strings:
if (preg_match('/^[A-Za-z0-9]+$/', $password)) { // Do …
Jump to Posthere is a regex that will make sure the password has at least 1 uppercase letter, 1 lower case letter, and a number. which is a pretty secure password.
preg_match( "/^.*(?=.{3,})(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).*$/",$password)
All 6 Replies
Will Gresham
81
Master Poster
shasha821110
0
Junior Poster
somedude3488
228
Nearly a Posting Virtuoso
shasha821110
0
Junior Poster
jeffc418
0
Junior Poster in Training
shasha821110
0
Junior Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.