|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2002-04-17 07:01 UTC] metz at speedpartner dot de
There are several reg.exp. around in Internet, but I'd like to see a function which checks if a string is a valid email-adress (is_email or valid_email or so)
Here is the regex:
^[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+'.'@('.'([-!#$%&\'*+\\/0
-9=?A-Z^_`a-z{|}~]+\.)'.'([-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+$))'
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 07:00:01 2025 UTC |
function validEmail($email_adresse) { if (eregi('^[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+'.'@('.'([-!#$%&\'*+\\/0-9=?A-Z^_`a-z{|}~]+\.)'.'([-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+$))', $email_adresse, $found)) { if (getmxrr($found[1], $mx_records)) { return $mx_records; } } return false; } this is php function to check an email about validity and existing mx records. :)