Jump to content

getting domain names from a url


prakash

Recommended Posts

I have a collection of URLs, for example:

 

http://story.news.yahoo.com/news/

http://www.amazon.com/exec/obidos/ASIN/B0000C0FKA/

http://www.metafilter.com/mefi/28945

http://www.s-curverecords.com/joss/

http://www.tenaciousd.com/

http://www.pugh.co.uk/

 

and I need to get only the main domain names from this list, eg:

 

www.yahoo.com

www.amazon.com

www.metafilter.com

www.s-curverecords.com

www.tenaciousd.com

www.pugh.co.uk

 

what is the code for it.

Link to comment
https://forums.phpfreaks.com/topic/55288-getting-domain-names-from-a-url/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.