title: Get domain name without port using HTTP_HOST
body: <p>When I check the logs there are a few rare occasions where for some visitors(bot I think) the <code>$_SERVER['HTTP_HOST']</code> is returning: www.domain.co.uk:80</p>
  
  <p>What is the correct way to get only the domain name without any ports?</p>
  
  <p>Should I be doing it this way instead:</p>
  
  <pre><code>$url_components = parse_url($_SERVER['HTTP_HOST']);
  $domain = $url_components['host'];
  </code></pre>
  
  <p>The strange thing is that I cant replicate this behavior it only appears in the logs. </p>