jj20051 Posted February 24, 2009 Share Posted February 24, 2009 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. Quote Link to comment https://forums.phpfreaks.com/topic/146648-copy-all-text-copy-all-links/ Share on other sites More sharing options...
MadTechie Posted February 24, 2009 Share Posted February 24, 2009 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! Quote Link to comment https://forums.phpfreaks.com/topic/146648-copy-all-text-copy-all-links/#findComment-769954 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.