Validate Domain

<?php

/**
 * validate_domain
 *
 * validate domain
 *
 * @version 0.5
 * @author Contributors at eXorithm
 * @link https://www.exorithm.com/algorithm/view/validate_domain Listing at eXorithm
 * @link https://www.exorithm.com/algorithm/history/validate_domain History at eXorithm
 * @license https://www.exorithm.com/home/show/license
 *
 * @param mixed $domain 
 * @return bool
 */
function validate_domain($domain='www.google.com')
{
	return preg_match ("/^[a-zA-Z0-9\-\.]+\.(com|org|net|mil|edu)$/i", $domain);
}

?>