check valid email and email domain in PHP

Viewed 86

i want to see if lazar@hotmail.com23 is valid (it isnt) in the PHP code here:

 // Remove all illegal characters from email
            $Buyer_Email = filter_var($Buyer_Email, FILTER_SANITIZE_EMAIL);

            // Validate e-mail
            if (filter_var($Buyer_Email, FILTER_VALIDATE_EMAIL) && preg_match('/@.+\./', $Buyer_Email) === false) {

but the code says its valid.

i checked online and i cant seem to figure out whats wrong

Whats wrong?

0 Answers
Related