Compare domains in php
<p>I wrote a small script that provided a URL (For example: code.google.com/ajax/123/1235/214)
Would tell you that the actual domain is: code.google.com</p>

<p>When this is compared to code.google.com it return true of course, i want it to return true when it is compared to (anything).google.com
So, i want it to return true whenever the actual domain is the same regardless of the subdomain, how to do that?</p>

<p>(This is NOT a homework question, it is for a project I am working on so please provide as much help as possible)</p>

<p>(if you need more information to understand the problem, please write a comment and I will provide more information immediately)</p>
