Where can one find information on where a dot can be placed in an email address and the allowed characters and lengths of each part?

To find information on where a dot can be placed in an email address and the allowed characters and lengths of each part, one can refer to the official RFC 5322 specification for email addresses. According to the specification, the local part of an email address (before the @ symbol) can contain letters, digits, and certain special characters, including dots. However, the dot cannot be the first or last character, and consecutive dots are not allowed. The domain part (after the @ symbol) has its own set of rules for characters and length.

$email = "john.doe@example.com";

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