note 9555 added to ereg

From: Date: Fri, 10 Nov 2000 19:01:27 +0000
Subject: note 9555 added to ereg
Groups: php.notes 
Request: Send a blank email to php-notes+get-7578@lists.php.net to get a copy of this message
10x to all for ideas and help. 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; } Of course the best way is to test if there is some kind of mail deamon run on specified host. http://www.php.net/manual/function.ereg.php

« previous php.notes (#7578) next »