Hey all. I have a list of URLs and need to get the domain (something.com, one.co.uk, etc.net) from that URL but am having a tricky time because there is an ever growing list of available extensions. It also complicates things having extensions with more then 1 dot like ".co.uk". It also complicates things having an infinate amount of subdomains and not just " Has anyone done this before? How would it be accomplished?
I'm thinking this is how it would be done, but not sure:
1: Remove " and "2: If there are any more slashes, remove them and everything else after that from the URL
3: Where to go from here? We have the site (something.site.co.uk), but what would be the next logical step? Ideally I would like to do it without having to list each domain extension, but not sure if this is possible.
Thanks for any help.
Andrew
I'm thinking this is how it would be done, but not sure:
1: Remove " and "2: If there are any more slashes, remove them and everything else after that from the URL
3: Where to go from here? We have the site (something.site.co.uk), but what would be the next logical step? Ideally I would like to do it without having to list each domain extension, but not sure if this is possible.
Thanks for any help.
Andrew