Re: String manipulation
| From: | Justin French | Date: | Thu, 24 Oct 2002 14:29:01 +0000 |
| Subject: | Re: String manipulation | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-121280@lists.php.net to get a copy of this message | ||
Well, what you really trying to do? Validate the format of an email
address? If so, what you really should be doing is looking for an existing
library of code which validates email address formats against the RFC
standard.
phpclasses.org is bound to have some, but I really like this one:
http://killersoft.com/modules.php?op=modload&name=News&file=article&sid=2
For your EXACT problem (making sure 'test.com' comes after the @), you could
use regular expressions... BUT test.com@test.com IS a valid email address,
so you'd be running into problems pretty quick :)
I looked into HEAPS of regexp's that claim to validate email address'...
HEAPS of them had problems that would bounce VALIDly formatted email
address... the killersoft one is the best I found...
Justin
on 25/10/02 12:12 AM, Francisco Vaucher (fvaucher@tycoint.com) wrote:
>
> Hi to all (again ;-)
>
> I need one or more PHP functions to handle a form input.
>
> i.e. you write: test@test.com
>
> I have to check that after the '@' comes 'test.com'. I think this is easy,
>
> Any help on this ?
>
> regards in advance...
>
> f.