Re: extracting the root domain from a URL [message #171652 is a reply to message #171642] |
Fri, 14 January 2011 08:43 |
alvaro.NOSPAMTHANX
Messages: 277 Registered: September 2010
Karma:
|
Senior Member |
|
|
El 13/01/2011 22:50, Mike escribió/wrote:
> Does someone know of a way to do this even with three letter domain
> names?
[...]
> if( isset($parts[2])&& strlen($parts[1])> 3) { unset($parts[2]); }
It'd dare say it's 3 because you hard-coded a 3 in your code.
Whatever, as Denis already explained, the number of parts in domains you
can buy do not follow any mathematical rule. E.g.: you can register
"example.es", "example.nom.es" and "example.co.uk" but not
"example.nom.uk" or "example.co.es".
The only way to do it off-line is to compile a full list from all
registrers around the world and keep it updated as the rules are being
changed across time.
--
-- http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
-- Mi sitio sobre programación web: http://borrame.com
-- Mi web de humor satinado: http://www.demogracia.com
--
|
|
|