Ereg() Function

From: Date: Fri, 23 May 2003 21:18:35 +0000
Subject: Ereg() Function
Groups: php.general 
Request: Send a blank email to php-general+get-148814@lists.php.net to get a copy of this message
If I wanted to check for a valid email address, basically and email that has @ and some domain like .edu, .net or something, why wont this work ? if (ereg ("^[\w.-]+@[\w.-]+\.(com|net|org|edu|mil|gov|gob|info|tv|biz) +(\.[A-Za-z]{2}|\s*)$", $_POST["emailaddy"])) { echo "doesnt appear to be a valid mail addy"; } Im not understanding why $_POST["emailaddy"] is not being evaluated correctly. Im putting in non-valid email addresses and I expect this to return true, but it doesnt. Any Ideas.? -Dan

« previous php.general (#148814) next »