Thursday , November 7 2024

Validate Email Address

Sometimes, while filling forms on your website, a user can mistype his email address. Using the below function you can check if the email provided by user is in correct format.

function is_validemail($email)
{
$check = 0;
if(filter_var($email,FILTER_VALIDATE_EMAIL))
{
$check = 1;
}
return $check;
}

 

Syntex:

<?php
$email = “blog@w2class.com”;
$check = is_validemail($email);
echo $check;
// If the output is 1, then email is valid.
?>

About admin

Check Also

Convert Text To Image

You can convert text to image by using this php code. You then download the image …

Leave a Reply