How do I get this text using PHP Simple HTML dom? -
assuming have html code in html source:
<div class="info"> <p><span class="strong">score</span>4.32/5</p> <p><span class="strong">type</span>tv</p> <p><span class="strong">episodes</span>13</p> <p><span class="strong">status</span>ongoing</p> <p><span class="strong">aired</span>oct 3, 2015 - dec 26, 2015</p> <p><span class="strong">age</span>pg-13 - teens 13 or older</p> </div>
how use php simple html dom text 4.32 above? tried
foreach($info_html->find('.strong') $library) { $rating = $library->innertext; var_dump($rating); }
but gives me text "score", want 4.32.
maybe give result looking for:
foreach($info_html->find('div.info p') $library) { $rating = $library->find('text', 1)->innertext; var_dump($rating); }
Comments
Post a Comment