PHP built-in function to determine if email is valid

Possible duplicate:
How to check email in PHP?

Does PHP have a built-in function for determining the correct formatting of email addresses. I know that he cannot go out and check if the email is really active; I am only saying that the email address is structurally correct.

+5
source share
1 answer

filter_var can do this:

$result = filter_var( 'bob@example.com', FILTER_VALIDATE_EMAIL );

It returns falsewhen it fails verification, and otherwise returns an email address.

+22
source

All Articles