<?xml version="1.0" encoding="UTF-8"?><!-- generator="bbPress" -->

<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
>

<channel>
<title>Forums Topic: Very simple function to validate email address in PHP</title>
<link>http://www.tutorialhelpdesk.com/forum/</link>
<description>Tutorialhelpdesk programming forums</description>
<language>en</language>
<pubDate>Sat, 22 Nov 2008 00:35:28 +0000</pubDate>

<item>
<title>no1skid on "Very simple function to validate email address in PHP"</title>
<link>http://www.tutorialhelpdesk.com/forum/topic/very-simple-function-to-validate-email-address-in-php#post-23</link>
<pubDate>Sat, 05 Jul 2008 06:09:23 +0000</pubDate>
<dc:creator>no1skid</dc:creator>
<guid isPermaLink="false">23@http://www.tutorialhelpdesk.com/forum/</guid>
<description>&#60;p&#62;Very basic email validation. I have a function that also uses regex, but also the &#60;a href=&#34;http://www.php.net/getmxrr&#34;&#62;&#60;em&#62;getmxrr&#60;/em&#62;&#60;/a&#62; function that searches dns for MX records corresponding the hostname.&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;function check_email($email)
{

// Create the syntactical validation regular expression
$match = &#38;quot;^([_a-z0-9-]+)(\.[_a-z0-9-]+)*@([a-z0-9-]+)(\.[a-0-9-]+)*(\.[a-z]{2,4})$&#38;quot;;

// Presume that the email is invalid
$valid = 0;

// Validate the syntax
if (eregi($match, $email))
{
list($username,$domain) = split(&#38;quot;@&#38;quot;,$email);

// Validate the domain
if (getmxrr($domain,$mxrecords))
$valid = 1;
}
else
{
$valid = 0;
}
return $valid;
}
?&#38;gt;&#60;/code&#62;&#60;/pre&#62;</description>
</item>
<item>
<title>thdadmin on "Very simple function to validate email address in PHP"</title>
<link>http://www.tutorialhelpdesk.com/forum/topic/very-simple-function-to-validate-email-address-in-php#post-15</link>
<pubDate>Wed, 02 Jul 2008 21:02:05 +0000</pubDate>
<dc:creator>thdadmin</dc:creator>
<guid isPermaLink="false">15@http://www.tutorialhelpdesk.com/forum/</guid>
<description>&#60;p&#62;The function uses regular expressions to validate the format of an email address. If you have questions and suggestions please let me know!&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;function isValidEmail($email)
{
	if(preg_match(&#38;quot;/[.+a-zA-Z0-9_-]+@[a-zA-Z0-9-]+.[a-zA-Z]+/&#38;quot;, $email) == 0)
		return false;
	else
		return true;
}&#60;/code&#62;&#60;/pre&#62;</description>
</item>

</channel>
</rss>
