The domain's need to be returned as the actual domain name, and the extension, separately
http://www.something.com
should return: sld = something
, tld= com
something.co.uk
should return: sld = something
, tld= co.uk
I am not much familiar with regular expressions, so I really need some help in handling this.
I suppose I can use parse_url()
, and check the host
, but what then?