Explanation of common email verification statements

xiaoxiao2021-03-06  41

I believe that people who have learned PHP should know the statement below for the Eamil check, but there are not many things that can really understand:

PHP code:

IF (EREGI ("^ [_. 0-9a-z -] @ ([0-9A-Z] .) [A-Z] $", $ EMAIL) {

Echo "Your E-Mail is initially checked";

}

?>

In this sentence, the first is to apply an EREGI function, which is still a good understanding. Just find this book, you can give you a paragraph: grammar: int EREG (String Pattern, String String, Array [Regs]); Return Value: Integer / array This function parses the comparison string string with Pattern rules. The value returned by the comparison result is placed among the array parameters, the contents of Regs [0] is the original string String, Regs [1] is the first rule of string, REGS [2] is the second rule String, residual push. If the parameter REGS is omitted, it is just a simple alignment, and the return value is true. It is not very good to understand that the previous regular expression is: ^ [_. 0-9a-z -] @ ([0-9A-z] [0-9A-Z -] .) [ AZ] $ In this regular expression, " " indicates that the front string will appear one or more; "^" indicates that the next string must appear at the beginning, "$" means that the previous string must appear in At the end; "". " "()" Means that the content containing must appear in the target object. "[_.0-9a-z-]" means any characters included in the numbers in the range of 0 to 9 in the range of 0 to 9, "[_.0-9a-z-]" means "_", ".", "-" As a result, this regular expression can be translated: "The following characters must be at the beginning (^)", "the character must be included in" _ ",". "," - ", from the A to Z, From 0 to 9 ([_.0-9A-z-]) ",", ",", ",", ", @," This string is included in the range from A to Z One letter, starting from the characters in the numbers in the range of 0 to 9, followed by at least one included in "-", any one in the range from A to Z, from 0 to 9 characters in the range of 0 to 9 Finally, at the end (([0-9A-z] [0-9a-z -] .) ",", ",", "," "" "" From A to Z) 2-3 times, and end with it ([AZ] $) "is very complicated, yes, because of this, people use regular expressions.

http://www.phpx.com/happy/top78551.html

转载请注明原文地址:https://www.9cbs.com/read-86492.html

New Post(0)