We're a community of 1.1M IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,080,594 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

Echo HTML tags using PHP DOM parser

Hello everyone!
I've been using this simple html parser here: http://simplehtmldom.sourceforge.net/, yes, its working like selecting all the divs with specified id's,but my question is, how about if i'm gonna include to show and select the tags like: <head> </head>, <div> </div>.

Any idea how to do this?

Thanks :)

2
Contributors
1
Reply
10 Hours
Discussion Span
2 Years Ago
Last Updated
2
Views
cursedever
Newbie Poster
1 post since Nov 2010
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

Look the source code of the page you are interested in. Let's say that the DIV you are interested in is the THIRD in the page's HTML source code (but it has no attributes - id, class, etc).

Since you know it is the third, then you can get it by issuing find('div', 2) . The first DIV would be on index zero; the second in index one, etc.

hielo
Veteran Poster
1,131 posts since Dec 2007
Reputation Points: 116
Solved Threads: 247
Skill Endorsements: 0

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
View similar articles that have also been tagged:
 
© 2013 DaniWeb® LLC
Page generated in 0.0540 seconds using 2.66MB