Trying to get code to search if \'@\' symbol is present in typed-in email address and echo if symbol is not. Everything works fine without the searching for @ code.
chec
try this :-
function isValidEmailAddr ($email) { if (filter_var($email, FILTER_VALIDATE_EMAIL)) { return true; } else { return false; } }
usage :-
include('path/to/lib.php'); $test = 'email@foo.bar'; if(isValidEmailAddr($test) == true){ echo "good to go"; } else { echo "try again babe!" }