all links on a page, and how many of these link to the same page again (how can we do that in php)?
<p>I am trying to write a small PHP function that would go through a page (provided a url) and would return the number of links and the number of links that link to the same page. For example, if I provide google.com as a URL it should return how many links are there on google.com and how many links link back to google.com (including of course www.google.com, google.com, google.com/#, etc)</p>

<p>Is that easy to do, and how would I do it?</p>

<p>(this is NOT a homework question so please provide as much help as possible</p>

<p>If you need more information about what I mean with the question just ask me to do provide more information</p>
