Codex

Function Reference/is email

Contents

Description

Verifies that an email is valid.

Usage

<?php is_email$email$check_dns ?>

Parameters

$email
(string) (required) Email address to check.
Default: None
$email
(string) (optional) Whether to check the DNS for the domain using checkdnsrr().
Default: false

Return Values

(string|bool) 
Either returns false or the valid email address.

Examples

<?php if (!is_email('email@domain.com'true)) {
      echo 
'email address is valid.';
?>

Notes

Does not grok i18n domains. Not RFC compliant.

Change Log

Since: 0.71

Source File

is_email() is located in wp-includes/formatting.php.

Related