title: Going where PHP parse_url() doesn't - Parsing only the domain
body: <p>PHP's parse_url() has a host field, which includes the full host.  I'm looking for the most reliable (and least costly) way to only return the domain and TLD.</p>
  
  <p>Given the examples:</p>
  
  <ul>
  <li><a href="http://www.google.com/foo" rel="noreferrer">http://www.google.com/foo</a>, parse_url() returns www.google.com for host</li>
  <li><a href="http://www.google.co.uk/foo" rel="noreferrer">http://www.google.co.uk/foo</a>, parse_url() returns www.google.co.uk for host</li>
  </ul>
  
  <p>I am looking for only <strong>google.com</strong> or <strong>google.co.uk</strong>.  I have contemplated a table of valid TLD's/suffixes and only allowing those and one word.  Would you do it any other way?  Does anyone know of a pre-canned valid REGEX for this sort of thing?</p>