note 53155 deleted from function.preg-match by jome
| From: | jome@php.net | Date: | Fri, 30 Sep 2005 19:00:17 +0000 |
| Subject: | note 53155 deleted from function.preg-match by jome | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-96081@lists.php.net to get a copy of this message | ||
Note Submitter: stoney666 at gmail dot com
----
Was just on Regular-Expressions.info, they have a good working regular expression for checking email
addresses. I wrote a short function to check if the email is valid, thought it could be usefull to
somebody.
<?php
function isvalidemail($email_address) {
if (preg_match("\b[A-Z0-9._%-]+@[A-Z0-9._%-]+\.[A-Z]{2,6}\b", $email_address) {
return true; }
else { return false; }
}
?>