getting base domain and sub domains from url?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello all,

I am trying to extract base domains and sub domains from url's, and
expect there to exist something to do this already.

I used the parse_url($url) to get the host variable.

My thought is to use $domain_elements[]=array_reverse(explode('.',$url));

then simply check $domain_element[0] against some base of
international+country specific extensions, if they have sub-extensions
like "co.uk" then add
a third level to the domain list , and set this up as base domain. Any
levels beyond the registrable domain names would count as sub domains.

What I would like to know is if there are some lists of all these base
domains, or maybe some function already doing what I would like to do?


In advance, thanks!

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux