I am trying to create a script that will extract the domain from a certain URL but no success. For example of url is http://www.testurl.tld/page1/2 I want to extract the domain from that url so the result must be testurl.tld Thanks in advance