title: Extract top domain from string php
body: <p>I need to extract the domain name out of a string which could be anything. Such as: </p>
  
  <pre><code>$sitelink="http://www.somewebsite.com/product/3749875/info/overview.html";
  </code></pre>
  
  <p>or</p>
  
  <pre><code>$sitelink="http://subdomain.somewebsite.com/blah/blah/whatever.php";
  </code></pre>
  
  <p>In any case, I'm looking to extract the 'somewebsite.com' portion (which could be anything), and discard the rest.</p>