Re: email address syntax checker

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

 



On Thu, 20 Jan 2011 19:03:22 +0530, Nilesh Govindarajan wrote:

> Well, I had created an email validator long ago, after a neat research 
> on Google, reading RFCs, etc.
> I don't guarantee that it's without bugs, but it has been correct for me 
> in all valid & invalid email addresses I used for test.
> 
> Code:
> 
> <?php
> 
> function checkMail($mail) {
> 
>    if(strlen($mail) <= 0) {
>      return false;
>    }
> 
>    $split = explode('@', $mail);
> 
>    if(count($split) > 2) {
>      return false;
>    }

<"@"@example.com> is not a valid address?


/Nisse

-- 
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