Syntax

boolean isemail(string $email)

(PHP 4, PHP 5)

$email Email to test if it is vaid or not
RETURNS True result if the argument contains a valid e-mail address, false otherwise.

What it Does

Tests an expression to see if it contains a valid e-mail address or not. This function uses an advanced regular expression (POSIX version) to check the string argument.

Function Declaration

function isemail($email) {
    return preg_match('|^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]{2,})+$|i', $email);
}
 
isemail.txt · Last modified: 2008/04/18 14:00 (external edit)
 
Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki