title: Compare two strings (urls) for same domain
body: <p>I'm trying to compare two urls using PHP, ensuring that the domain name is the same. It cannot be the sub-domain. It has to literally be the same domain. Example:</p>
  
  <p><code>http://www.google.co.uk</code> would validate as <code>true</code> compared to <code>http://www.google.co.uk/pages.html</code>.</p>
  
  <p>but</p>
  
  <p><code>http://www.google.co.uk would</code> validate as <code>false</code> compared to <code>http://www.something.co.uk/pages.html</code>.</p>