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 Quote 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 Quote Link to comment https://forums.phpfreaks.com/topic/187849-php-simple-html-dom/#findComment-1004936 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.