Php code used to determine whether the email address is a valid email address. This article introduces a user-defined function, that is, to determine whether the email address is a valid email address, which we often call regular expression verification. This article introduces a user-defined function, that is, to determine whether the email address is a valid email address, which we often call regular expression verification.
The code is as follows: |
|
// Function name: CheckEmailAddr ($ C_mailaddr) // Usage: determines whether the email address is a valid email address. // Parameter: $ C_mailaddr (email address to be detected) // Return value: Boolean // Standby Note: None Function CheckEmailAddr ($ C_mailaddr) { If (! Eregi ("^ [_ a-z0-9-] + (. [_ a-z0-9-] +) * @ [a-z0-9-] + (. [a-z0-9-] +) * $ ", $ C_mailaddr )) //(! Ereg ("^ [_ a-zA-Z0-9-] + (. [_ a-zA-Z0-9-] +) * @ [_ a-zA-Z0-9-] + (. [_ a-zA-Z0-9-] +) * $ ", $ C_mailaddr )) { Return false; } Return true; } |
Token is actually the address of the regular expression verification email address. Code...