Jump to content

Gather links?


magnetica

Recommended Posts

What exactly do you mean? Do you mean there is a website which has lots of <a href=...> tags that you would like to find and get the addresses of the websites they link to?

 

If so, then yes, its completely possible. You'll firstly need to get the contents of the website, which can, in most cases, be achieved with the use of the file_get_contents() function. With some websites, you will need to use cURL however.

 

Once you have the contents of the website in a string, you'll need to use regular expressions to find the links. You'll be wanting the preg_match_all() or the ereg() functions for that.

 

Edit: I just noticed you said 'using html'. If thats what you meant, then no, its not possible. I misread that as 'using php'.

Link to comment
https://forums.phpfreaks.com/topic/72216-gather-links/#findComment-364153
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.