04-22-2008, 02:45 PM
|
#1 (permalink)
|
|
The Acquainted
Join Date: Apr 2008
Posts: 110
Thanks: 97
|
Data validation syntax -- looks Greek to me
Hi, all...
This is part of an example from one of the books I am using to learn PHP.
I understand the purpose, but I need help understanding the specifics of the
"^([_a-z.... etc.
section of the code. I've already gone to the PHP Manual and did not manage to find specific help on this.
Thanks very much...
Dave
===============================
PHP Code:
function validate_email($email)
{
# Create the syntactical validation regular expression
$regexp = "^([_a-z0-9-]+)(\.[_a-z0-9-]+)*@([a-z0-9-]+)
(\.[a-z0-9-]+)*(\.[a-z]{2,6})$" ;
# Validate the syntax
if (eregi($regexp, $email)) return 1;
else return 0;
}
|
|
|
|