The method checkEmail is a function in PHP that validates an email address. The function checks if the email address provided by the user is correctly formatted or not.
Examples:
1. Check if the email address is valid or not. $input_email = "abc@gmail.com"; if (filter_var($input_email, FILTER_VALIDATE_EMAIL)) { echo("$input_email is a valid email address"); } else { echo("$input_email is not a valid email address"); }
2. Check if the email address is from a valid domain name or not. $input_email = "abc@gmail.com"; list($username, $domain) = explode('@', $input_email); if (!checkdnsrr($domain, "MX")) { echo("$input_email is not a valid email address from a valid domain."); }
The package library used for the checkEmail method is built-in PHP functions.
PHP User::checkEmail - 29 examples found. These are the top rated real world PHP examples of User::checkEmail extracted from open source projects. You can rate examples to help us improve the quality of examples.