protected function isValidDomainName($domain_name) {
		return (preg_match('/^([a-z\d](-*[a-z\d])*)(\.([a-z\d](-*[a-z\d])*))*$/i', $domain_name) //valid chars check
			&& preg_match('/^.{1,253}$/', $domain_name) //overall length check
			&& preg_match('/^[^\.]{1,63}(\.[^\.]{1,63})*$/', $domain_name)   ) //length of each label
			&& count(explode('.', $domain_name))>1;
	}
protected function isValidDomainName($domain_name) {
		return (preg_match('/^([a-z\d](-*[a-z\d])*)(\.([a-z\d](-*[a-z\d])*))*$/i', $domain_name) //valid chars check
			&& preg_match('/^.{1,253}$/', $domain_name) //overall length check
			&& preg_match('/^[^\.]{1,63}(\.[^\.]{1,63})*$/', $domain_name)   ) //length of each label
			&& count(explode('.', $domain_name))>1;
	}
protected function isValidDomainName ( $ domain_name ) { return ( preg_match ( '/^([a-z\d](-*[a-z\d])*)(\.([a-z\d](-*[a-z\d])*))*$/i' , $ domain_name ) //valid chars check && preg_match ( '/^.{1,253}$/' , $ domain_name ) //overall length check && preg_match ( '/^[^\.]{1,63}(\.[^\.]{1,63})*$/' , $ domain_name ) ) //length of each label && count ( explode ( '.' , $ domain_name ) ) > 1 ; }
Checks if the given string looks like a valid domain name
@param $domain_name
@return bool
Checks if the given string looks like a valid domain name