Are there any limitations to using filter_var() for email validation in PHP?

While filter_var() can be used for basic email validation in PHP, it has some limitations. It may not catch all edge cases or validate the full range of valid email addresses according to the RFC standards. To ensure more comprehensive email validation, it's recommended to use a dedicated email validation library or combine filter_var() with additional validation techniques.

$email = "example@example.com";

if (filter_var($email, FILTER_VALIDATE_EMAIL)) {
    echo "Valid email address";
} else {
    echo "Invalid email address";
}