Re: Check if var is a domain name

From: Date: Wed, 06 Feb 2002 10:26:42 +0000
Subject: Re: Check if var is a domain name
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-83694@lists.php.net to get a copy of this message
You can online check for a valid domain using if (checkdnsrr($mydomain, "SOA")) { echo("is valid domain"); } note that www.mynewdomain.com CAN be a valid domain also. bvr. On Tue, 5 Feb 2002 07:59:22 -0800, Brandon Orther wrote: >Hello, > >Does anyone know a function or how I could make a function to check a >variable for being a valid domain name without the "www. ><http://www./> >" In fron of it? > >Ex. $var = "mynewdomain.com" that would be TRUE > >Ex2. $var = "www.mynewdomain.com" that would be FALSE > >Ex3. $var = "My Great Domain" that would be FALSE > >And so on. > >Does anyone have a function that makes sure there are no illegal >characters and there is a period in the middle of the text? > > >-------------------------------------------- >Brandon Orther >WebIntellects Design/Development Manager >brandon@webintellects.com >800-994-6364 >www.webintellects.com >-------------------------------------------- > >

« previous php.general (#83694) next »