I searched the forum for posts about validating domain names and found a suggestion of:
Would that permit suffixes like .co.uk, .org.uk, etc? It looks like it might only allow .com, .net, etc.PHP Code:preg_match('/^([a-z0-9][a-z0-9\-]*[a-z0-9]\.)+[a-z]{2,6}$/i', $domain, $matches);
I need to allow domain names with two-part suffixes, since most of my site's visitors will likely be using them, and also allow them to include the www. prefix but not http:// . What do I need to change in the above example?






Bookmarks