note 16554 added to function.ereg

From: Date: Sun, 04 Nov 2001 03:54:36 +0000
Subject: note 16554 added to function.ereg
Groups: php.notes 
Request: Send a blank email to php-notes+get-20408@lists.php.net to get a copy of this message
Sorry, i submitted the wrong code; I would prefer this code to check an email-address: $email = "very_strange.email-address___@very-very.very.long.domain.coop"; if(ereg("^[0-9a-z]([-_.]?[0-9a-z])*[_]*@[0-9a-z]([-.]?[0-9a-z])*\.[a-z]{2,4}$", $email)) { echo $email . " is valid"; } else { echo $email . " is invalid"; } btw: this one would be valid -- http://www.php.net/manual/en/function.ereg.php http://master.php.net/manage/user-notes.php?action=edit+16554 http://master.php.net/manage/user-notes.php?action=delete+16554 http://master.php.net/manage/user-notes.php?action=reject+16554

« previous php.notes (#20408) next »