PHP user registration Information Validation regular expression, user registration regular expression
The following method of verifying the username is the principle that the user name must be composed of alphanumeric bands with a dash, let's take a look at the example below.
1. Check whether the user name conforms to the specified "two-bit letters, numbers, or underscores", the code is as follows:
/** * Check if user name is compliant * * @param STRING $username username to check * @return TRUE or FALSE
More than two letters, numbers, or underscores : ^[a-za-z0-9_\x7f-\xff][a-za-z0-9_\x7f-\xff]+$.
Note: Here, the letters are a-z,a-z, and ASCII characters from 127 to 255 (0X7F-0XFF)
2, Password:6-20-bit, composed of letters, numbers, the code is as follows:
3, email verification , the code is as follows:
This article for everyone to share the user registration information: User name, password and the regular expression of mailbox verification, I hope that we seriously learn this "PHP user registration information Verification Regular expression", will have some gains.
http://www.bkjia.com/PHPjc/1071231.html www.bkjia.com true http://www.bkjia.com/PHPjc/1071231.html techarticle PHP User registration Information Validation regular expression, user registration regular expression The following is the method principle of verifying user name in such a way that the user name must be a group of alphanumeric bands with a set of dashes ...