Jump to content

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!

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.