Q:

Write a simple PHP program to check that email id is valid or not

belongs to collection: PHP basic programs with examples

0

Write a simple PHP program to check that email id is valid or not

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

PHP is a server scripting language, and It is a powerful tool for making interactive and dynamic Web-pages. I have used WampServer 2.2 for following excercise..

<?php
// Passing valid/invalid email
$email = "techstudy.org@gmail.com";
if (filter_var($email, FILTER_VALIDATE_EMAIL)) 
{     
 
     echo '"' . $email . '" is valid Email ID'."\n";
}
else 
{     
     echo '"' . $email . '" is invalid Email ID'."\n";
}
?>

Result:

"techstudy.org@gmail.com" is valid Email ID

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Write a PHP script to display string, values withi... >>
<< Write a PHP script to redirect a user to a differe...