Re: Richard Lynch's Email Address ...

From: Date: Thu, 10 Nov 2005 00:30:44 +0000
Subject: Re: Richard Lynch's Email Address ...
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-225482@lists.php.net to get a copy of this message
On 11/9/05 7:20 PM, GamblerZG wrote:
James Benson wrote:
Would it not be better something like valid_email()
email_validate()? Anyway, I agree that PHP needs such function.
Check out http://pecl.php.net/package/filter <?php $clean['email'] = input_get(INPUT_POST, 'email', FL_EMAIL); ?> I've been playing around with this for a while, and it should be noted that it's still in beta and should not be used in a production environment, but it's a promising step. The e-mail regex that's used isn't perfect, and it won't support RFC-compliant addresses, but I hope to put a little bit of work into it to help out with this. In the meantime, check out PEAR::Mail, which includes Mail_RFC822 that can be used to validate e-mail addresses. Also, if your PHP is compiled --with-imap, then you can use imap_rfc822_parse_adrlist() to validate e-mail addresses. -- Ben Ramsey http://benramsey.com/

« previous php.general (#225482) next »