Bug #16655 Updated: Function for checking if email-adress is valid
| From: | metz at speedpartner dot de | Date: | Wed, 17 Apr 2002 14:13:22 +0000 |
| Subject: | Bug #16655 Updated: Function for checking if email-adress is valid | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-5200@lists.php.net to get a copy of this message | ||
ID: 16655
Updated by: metz@speedpartner.de
Reported By: metz@speedpartner.de
Status: Open
Bug Type: Feature/Change Request
Operating System: Linux
PHP Version: 4.1.2
New Comment:
but isn't it possible to add this function to the "standard repertoir"
of php?
I think many people will use it and at the moment everyone writes his
own "version" of this function.
Previous Comments:
------------------------------------------------------------------------
[2002-04-17 10:11:00] jtate@php.net
Probably belongs in PEAR not PHP, along with the URL-ize function
mentioned in a bug report yesterday (#16642). Now... Which module does
it belong in?
------------------------------------------------------------------------
[2002-04-17 07:19:12] bate@php.net
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. :)
------------------------------------------------------------------------
[2002-04-17 07:01:32] metz@speedpartner.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{|}~]+$))'
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=16655&edit=1