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)
Is that easy to do, and how would I do it?
(this is NOT a homework question so please provide as much help as possible
If you need more information about what I mean with the question just ask me to do provide more information