Home >Backend Development >PHP Tutorial >PHP verify whether the username starts with a letter and verify the password example_PHP tutorial
This article describes the method of php verifying whether the username starts with a letter and verifying the password. Share it with everyone for your reference. The details are as follows:
Verify that the username starts with a letter and verify that the password can only be a combination of numbers and letters. Three commonly used verification functions: verify the email address format, verify that the password can only be a combination of numbers and letters, and verify that the username starts with A code starting with a letter, which is used when a user registers or submits a form.
The code is as follows:
/**
* The verification password can only be a combination of numbers and letters
*/
function is_psd($psd)
{
if (preg_match("/^(w){4,20}$/",$psd,$password))
{
Return true;
}
else
{
Return false;
}
}
I hope this article will be helpful to everyone’s regular expression learning.