title: How to get domain name with PHP
body: <p>I know (and see) that this question has been asked for about a thousand times, but, after search and search, and somewhat confusing answers, i'm still looking for a right answer.</p>
  
  <p>All I need is to identify my domain from url like (<a href="http://www.example.com" rel="nofollow">http://www.example.com</a>; or <a href="http://example.com" rel="nofollow">http://example.com</a> or www.example.com or just example.com) (no subdomains-for now) with PHP.</p>
  
  <p>I'm creating a simple website, but hosted on 2 seperate domains (with same contents), and i need to identify on which site (domain) user is, in order to display the right logo, disclaimer etc.</p>
  
  <p>Thanks.</p>