note 14816 added to function.ereg.php

From: Date: Wed, 15 Aug 2001 23:23:36 +0000
Subject: note 14816 added to function.ereg.php
Groups: php.notes 
Request: Send a blank email to php-notes+get-16785@lists.php.net to get a copy of this message
NEW Result: For checking validity of an email. function checkmail ($email) { if (eregi("^[0-9a-z]([-_.]?[0-9a-z]*)*@[0-9a-z]([-.]?[0-9a-z])*\\.[a-wyz][a-z](g|l|m|pa|t|u|v)?$", $email, $check)) { if (checkdnsrr(substr(strstr($check[0], '@'), 1), "ANY")) { return TRUE; } } return FALSE; } I added a "*" to the above function checkmail, because of matching emails like "mymail.@myprovider.com" http://www.php.net/manual/en/function.ereg.php

« previous php.notes (#16785) next »