Thursday, January 20, 2011

Email address validation in PHP using REGEX

Code to validate:

if (eregi('^[a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+\.([a-zA-Z]{2,4})$',$_REQUEST['email'])) { 
    echo 'Valid'; 
       } else { 
    echo 'Invalid'; 
       }

No comments:

Post a Comment

Customizing the Search form - Drupal

To change the label text and text inside the search box and the text on the submit and changing the Submit button image, you can use the fo...