title: PHP get domain name
body: <p>I want to get the domain name for where the script is running. How can that be done with PHP?
  I see that <code>$_SERVER['HTTP_HOST']</code> as well as <code>$_SERVER['SERVER_NAME']</code> contain this information.
  Will that variable always work and should I use one over the other?</p>
  
  <p>Thank you.</p>