How can one check if a "." and "@" are present in a form field in PHP?

To check if a "." and "@" are present in a form field in PHP, you can use the strpos() function to search for these characters in the input string. If both characters are found, it indicates that the input may be an email address. You can then perform further validation checks to ensure the email address is properly formatted.

$input = $_POST['email'];

if (strpos($input, '.') !== false && strpos($input, '@') !== false) {
    // Email address contains both "." and "@"
    // Further validation can be done here
    echo "Valid email address";
} else {
    echo "Invalid email address";
}