Bug #16655 Updated: Function for checking if email-adress is valid

From: Date: Wed, 17 Apr 2002 11:19:12 +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-5185@lists.php.net to get a copy of this message
ID: 16655 Updated by: bate@php.net Reported By: metz@speedpartner.de Status: Open Bug Type: Feature/Change Request Operating System: Linux PHP Version: 4.1.2 New Comment: 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. :) Previous Comments: ------------------------------------------------------------------------ [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

« previous php.bugs (#5185) next »