pitbullent Posted September 17, 2009 Share Posted September 17, 2009 Hi! I'm SO CONFUSED. OK all I want to do is use PHP to access a specific website and display only the content of a specific DIV on that website. The class of the div is "content_box". <div class="content_box"> My thoughts lead me to think that I can use $results = file_get_contents('website'); to put all of the HTML into a variable and then use one of the preg functions to extract the div and display it. preg_match('<div class=\"content_box\"> *allow anything including nested divs* </div>', $results, $div); print $div; This is where my ideas fall apart. I have absolutely no idea on how to get started on the regex for a specific div much less allowing for nested divs. Is this the wrong approach altogether? Thank you so much in advance for any ideas or code you can supply! Quote Link to comment Share on other sites More sharing options...
.josh Posted September 17, 2009 Share Posted September 17, 2009 DOM Quote Link to comment Share on other sites More sharing options...
pitbullent Posted September 18, 2009 Author Share Posted September 18, 2009 COOL!! thank you i am definitely going to look into that tommorow Quote Link to comment 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.