I am trying to count the number of links on a page. That is every link, internal, external etc. I have been trying but cant seem to figure it out. I already have the box where I can input the URL of the page I want to check but cant get the result. Does anyone know how to solve this?
You will need to do the following: 1. file_get_contents of the URL 2. preg_match_all to extract the links on the page (using a proper link regex) 3. get the count of links
You can do it bit by bit. I mean you will easily find examples for every step I mentioned even on php.net itself.
I am hoping to use this to check multiple pages and provide a count of the links, not just see a list of them. This will be used as part of a larger tool so it needs to be incorporated into a larger script. Thanks for the reply though.