Bladephp: Now with 8+ codeigniter, php, and laravel project 8+ php project From $37/Month From Rs. 2499/Month

How to PHP Validate Email

by
Category:php
php
How to PHP Validate Email

Here's the absolute easiest way you can validate an email address using PHP. This tiny function takes advantage of the filter_var() function in PHP.

Code

$email = test_input($_POST["email"]);
if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
  $message = "Invalid email format";
}

 


0 Comments


Html code work in comment box


Related Post