I want to get domain name from the full URL without tld, www, subdomain.
e.g. if I am having URL like
http://subdomain.example.com OR
example.com
it should return example
How can I get it? I tried parse_url but it returned me the URL with tld & subdomain. Plesae help me. Thanks in advance.