All pastes #35239 Raw Edit

Untitled

public text v1 · immutable
#35239 ·published 2005-12-30 02:12 UTC
rendered paste body
<?php

#	Wildhoney's Email Validation Function
#		Using regular expression and MX record validation.

	function validateEmail($x) {
		if(eregi('^[a-zA-Z0-9._-]+@[a-zA-Z0-9-]+\.[a-zA-Z.]{2,6}$', $x) === 1) {
			list($user, $domain) = split("@", $x);
			if(checkdnsrr($domain) === true) {
				return 1;
			} else {
				return 0;
			}
		} else {
			return 0;
		}
	}
?>