How to Get The Domain and TLD from a URL using PHP and Regular Expression

How to get a domain and it’s TLD from a URL string using PHP and Regular Expression:

preg_match("/[a-z0-9\-]{1,63}\.[a-z\.]{2,6}$/", parse_url($_url_string, PHP_URL_HOST), $_domain_tld);
echo $_domain_tld[0];

This is particularly useful for dealing with country TLD’s, like, on.gc along with the general .com, .net, etc.
It is also capable of ruling-out multiple subdomains like: so you end up with just

If you are interested in sharing a regular expression that is better at handling URL strings, please post a comment below.