Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
FILTER_VALIDATE_EMAIL constant in PHP
The FILTER_VALIDATE_EMAIL() constant validates an email address.
Return
The FILTER_VALIDATE_EMAIL() does not return anything.
Example
<?php
$myEmail = "examplee@demo.com";
if (filter_var($myEmail, FILTER_VALIDATE_EMAIL)) {
echo("$myEmail = valid email address");
} else {
echo("$myEmail = invalid email address");
}
?>
Output
The following is the output.
examplee@demo.com = valid email address
Advertisements