Possible Duplicate:
How to parse HTML with PHP?

i wish to write a php-program that count all hyperlinks of the website, the consumer can enter.

how to get this done? it is possible to libary or something like that that we can parse and evaluate the html concerning the hyperlinks?

interesting help

Such as this

$site  = file_get_contents("someurl");
$links = substr_count($site, "<a href=");
print"There is {$links} in that page.";

Well, we will not have the ability to provide you with a finite answer only pointers. I have done a internet search engine once from php therefore the principle would be the same:

  1. To begin with you have to code your script like a console script, an internet script isn't appropriate but it is all an issue of tastes
  2. You must know working with electrical sockets in PHP making demands, consider the php socket library at: http://www.php.net/manual/ref.network.php
  3. You will have to get experienced on the planet of HTTP demands, learn to build your own GET/Publish demands and split the headers in the came back content.
  4. Last part is going to be easy with regexp, just preg_match this content for "#()*#i" (the final expression may be wrong, i did not test drive it whatsoever ok?)
  5. Loop their email list of found hrefs, rival already visited hrefs (make sure to consider wildcard GET params inside your stuff) after which do this again to load all of the pages of the site.

It's Effort... best of luck

You might want to use CURL to fetech the items in the web page. Store that inside a variable then parse it for hyperlinks. You will need regular expression for your.