-1

Given a HTML like this:

(...)
<div class="UserLevel type_2">
    <span class="LevelNum">23</span>
</div>
(...)

How to get the 23 as a php var using simple_html_dom given the wanted part is inside the span of class LevelNum ?

Thanks

bockzior
  • 199
  • 1
  • 6
  • 20

2 Answers2

1

straight out of Simple HTML DOM documentation, have you tried something like

$something = $object->find('span[class=LevelNum]');
1

Can you try :

foreach ($html->find('div[class=UserLevel type_2]') as $div);
foreach($div->find('LevelNum') as $element) 
    echo $element->innertext;
Dipak G.
  • 715
  • 1
  • 4
  • 18