Jump to content

PHP Simple HTML DOM


JoeLongstreet

Recommended Posts

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

  • 4 weeks later...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.