954,597 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

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: , .

Any idea how to do this?

Thanks :)

cursedever
Newbie Poster
1 post since Nov 2010
Reputation Points: 10
Solved Threads: 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,124 posts since Dec 2007
Reputation Points: 116
Solved Threads: 244
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: