Re: Richard Lynch's Email Address ...

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux