FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » extracting the root domain from a URL
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: extracting the root domain from a URL [message #171643 is a reply to message #171642] Thu, 13 January 2011 22:29 Go to previous messageGo to previous message
Captain Paralytic is currently offline  Captain Paralytic
Messages: 204
Registered: September 2010
Karma:
Senior Member
On Jan 13, 9:50 pm, Mike <mpea...@gmail.com> wrote:
> Given any valid URL, I'd like to extract the root domain like this:
>
> http://www.site.com                   = site.comhttp://xxx.yyy.site.com            = site.comhttp://subdomain.site.com                = site.comhttp://www.site.com.tw              = site.com.twhttp://xxx.yyy.site.com.asia  = site.com.asiahttp://subdomain.site.com.af  = site.com.af
>

You can't extract the root domain like that because the "root domain"
is the .com, .asia, .tw, .af part.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: printing for dot matrix printers
Next Topic: having better solution to promote your products.
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Tue Nov 26 23:54:18 GMT 2024

Total time taken to generate the page: 0.04318 seconds