Stumbled on something handy that I can’t believe I’m just now finding.  Gotta love PHP convenience, including this built-in way to validate form input.

PHP filter_var

Thanks again, NETTUTS (tutorial here).

if (isset($_POST['email'])) {
$email = filter_var($_POST['email'], FILTER_SANITIZE_EMAIL);
if (filter_var($email, FILTER_VALIDATE_EMAIL)) {
echo "$email is a valid email address.";
} else {
echo "$email is NOT a valid email address.";
}
}
// also FILTER_SANITIZE_URL, FILTER_VALIDATE_URL