title: Get domain address of calling webpage in PHP
body: <p>I want to apply check only a specific website domain can hit my site. I tried <code>$_SERVER['HTTP_REFERER']</code> but i am getting the full url.But i just want the domain address like <code>www.example.com</code> not all the url. I tried to explode but in the start i am getting <code>http:\\</code> so when i explode on \ this .It explode the http section as well. Is there any other way so i can get on the domain url. </p>
  
  <p>if the url is <a href="http://www.example.com/test.php" rel="nofollow noreferrer">http://www.example.com/test.php</a> i only want <a href="http://www.example.com" rel="nofollow noreferrer">http://www.example.com</a>. I have also used explode but explode function explode the http/ section first.I want the url of another website who's hitting my website</p>