PHP Questions Home

Categories

Arrays
Files
Forms
Functions
Images
MySQL
Numbers
Others
Strings
Website


PHP Functions

PHP Functions


More PHP

Top Questions
Ask a Question

How do I check that a valid email address is entered?


To do this you will need to use a regular expression.

The best these can do is check that it appears to be in a valid format, of course there is no way to check if sending an email to that address will get delivered - short of actually sending a message and checking that there is no bounce!

These tend to look horrendously complicated and so rather than work one out, find one you like off an internet site and go with that.

There are many candidates out there, here is one possibility:

^[^@]{1,64}@[^@]{1,255}$

More forms PHP Questions

How can I access information sent through GET on a form?
How do I know if magic quotes is switched on?
How do I remove HTML tags from a string?
How can I check that a data value is alphanumeric?
How do I escape data that is going into a database?