Search found 1 match

by borisboris
Tue Jul 19, 2011 3:33 pm
Forum: PHP - Code
Topic: Validating email with regular expressions(preg_match)
Replies: 3
Views: 666

Validating email with regular expressions(preg_match)

I'm a PHP newbie. I have the following code but cannot get it to work, any ideas on how to make this code work: $email = "myemail@yahoo.com"; $good_email = ([a-zA-Z0-9]+@[a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+)+"; if (preg_match(/"$good_email"/, $email)) { echo $email." is a val...