I have a section of html code like this :
<a>
<img scr=""/>some text here...
</a>
<a>
<img scr=""/>some text here...
</a>
I need to get the some text here...
i was trying like this : let say the section above is in a html dom.$html
foreach ($html->find('a') as $myText)
{
echo '-----PPPP---->>>>'.$myText->plaintext.'this is test<br/>';
}
But it's printing the text and image both.I just need the text
->plaintextshould only retrieve text nodes from the node you're dealing with.->innertextwould return child nodes as well as the text.DOMDocumentand then just use an xpath expression to obtain the text.