Darkbyte Library

Nonstandard Web Browser

It appears that your browser does not comply with the W3C web standards which define how web pages are encoded, transmitted, and rendered. This site would look much better in a standards-compliant web browser, but its content is accessible to any browser or Internet device.

isValidEmailAddress() :: Validate Email Addresses using PHP.

Download

License : LGPL

Description :
A simple function to validate an email address.

Source Code :


<?php
	/**************************************************************************
	 * validemail.php
	 * --------------
	 * Author: Alan Doyle (alan.doyle@darkbyte.com)
	 * Copyright: (c) 2005 Darkbyte Software
	 * Release Version: 1.0
	 * Date Started: 2005/06/20
	 *
	 * Tests if an email address is valid.
	 *
	 **************************************************************************
	 *
	 *   validemail.php is free software; you can redistribute it and/or modify
	 *   it under the terms of the Lesser General Public License as published by
	 *   the Free Software Foundation; either version 2 of the License, or
	 *   (at your option) any later version.
	 *
	 *   validemail.php is distributed in the hope that it will be useful,
	 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
	 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	 *   GNU General Public License for more details.
	 *
	 *   You should have received a copy of the Lesser General Public License
	 *   along with validemail.php; if not, write to the Free Software
	 *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
     *   USA
	 *
	 *************************************************************************/
 
function isValidEmailAddress($emailAddress)
{
    /* If the email address was not empty */
    if($emailAddress != "")
        return preg_match("/^[^@]+@[^@]+\.[^@]{2,}$/", trim($emailAddress));
 
    return false;
}
?>
Copyright © 2000-2008 Darkbyte Software, All Rights Reserved. 
Please direct your questions or comments to

CCBot/1.0 (+http://www.commoncrawl.org/bot.html) [38.103.63.57 ( )]