title: Getting domain extension from URL?
body: <p>I want to get the domain extension from the url. eg. .com, .net etc.</p>
  
  <p>I have used this:</p>
  
  <pre><code>$extension = pathinfo($_SERVER['SERVER_NAME'], PATHINFO_EXTENSION);
  </code></pre>
  
  <p>I was just wondering if there was a better way using parse_url?</p>