Email Validation

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
Zoram
Forum Contributor
Posts: 166
Joined: Sun Aug 18, 2002 3:28 pm
Location: Utah
Contact:

Email Validation

Post by Zoram »

How would i validate if the input email address really is an email address?
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

search for "validate AND email"
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

Things like this are also readily available from the user comments on the regular expression functions in the PHP manual.

Mac
SuperHuman
Forum Newbie
Posts: 10
Joined: Wed Oct 16, 2002 10:00 pm

Post by SuperHuman »

Code: Select all

<?php


$email = ' ';
if ( preg_match( '/^їA-z0-9_-]+ї@]їA-z0-9_-]+(ї.]їA-z0-9_-]+)+їA-z]{2,4}$/', $email ) ) {
      echo 'Valid email in type...';
} else {
      echo 'Not valid in type...';
}


?>
Post Reply