All Entries Tagged With: "validate"
PHP Validate Email Address
When a user submits their email address in a form, you want to be sure it is a real email address. We will use the function preg_match() to see if it matches our regex for emails. <?php // Validate.php function check_email($email){ $email = trim($email); if(preg_match("/^[a-z0-9&'\.\-_\+]+@[a-z0-9\-]+\.([a-z0-9\-]+\.)*+[a-z]{2}/is", $email)){ // the email address matches our regex, now make [...]
