What is the purpose of using a wildcard in an email address check in PHP?

When checking email addresses in PHP, using a wildcard can be helpful to allow for flexibility in the domain part of the email address. This can be useful when validating email addresses from multiple domains or when the exact domain is not known but a general pattern is expected.

$email = "example@domain.*";

if (filter_var($email, FILTER_VALIDATE_EMAIL)) {
    echo "Email address is valid.";
} else {
    echo "Email address is not valid.";
}