I have divs with same Class value;
<div class="description">Div 1</div>
<div class="description">Div 2</div>
<div class="description">Div 3</div>
and I can parse and display them all with this code:
foreach($html->find('.description') as $icerik) { echo '<b>'.$icerik->plaintext.'</b>'; }
Now I want to display them individually. How to make them parse and display like first div, second div and third div?
Thanks.
$html->find('.description')[0]->plaintextwork? It's referred to as array dereferencing implemented in 5.4.$html->query("//*[@class='description']")->item(0)->nodeValue;