Jump to content

Copy All Text & Copy All Links


jj20051

Recommended Posts

This is more of a 2 question post, so bear with me on this. They are both separate questions... I need to do two things:

 

1. I need to get php to take any url I enter, strip off all the formatting of the site, and place all the text into a variable. ( So it would strip off all the css, images, and other code and just leave the text, no links either ).

 

2. I need to be able to take all of the links off a page and place them in a database ( one per row ). I can do the database part, but how do I get the links together. I'm pretty sure this has something to do with a while() loop...

 

 

If you can teach me how to do either of these or point me somewhere it would be great.

Link to comment
https://forums.phpfreaks.com/topic/146648-copy-all-text-copy-all-links/
Share on other sites

Okay,

 

Well getting the contents would be simple

$x = file_get_contents("http://domain.com/blar");

removing tags.. strip_tags() or a regex would clean up most..

 

Well their will be no links, as you wanted them removed "no links either"

but again a regex could get these..

 

I don't mind helping but i won't write it for you (i get paid for that), if you write what you can and post your code i'll help from their!

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.