JoeLongstreet Posted January 9, 2010 Share Posted January 9, 2010 I'm using the "PHP Simple HTML DOM Parser" - http://simplehtmldom.sourceforge.net/manual.htm I'm running through a bunch of elements and I need to determine what kind of element it is that I'm returning. For example <html> <div id='wrap'> <h1>Heading</h1> <p>something</p> <p>something</p> <h2>Second Heading</h2> </div> </html> //PHP $html = 'http://somehtmldoc.html' foreach($html->find('div[id=wrap]') as $thing) { $var = $thing->this should tell me if it's an h4, p, h1, etc. } Any help is much appreciated. Thanks, Joe Link to comment https://forums.phpfreaks.com/topic/187849-php-simple-html-dom/ Share on other sites More sharing options...
drumstok Posted February 1, 2010 Share Posted February 1, 2010 http://simplehtmldom.sourceforge.net/manual_api.htm Just access the "tag" property: $element->tag Link to comment https://forums.phpfreaks.com/topic/187849-php-simple-html-dom/#findComment-1004936 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.