1

I want to get image and any text between td tag and I'm using DOMDocument class.
Below code could not get and parse image tag with any text between td.
For example :

$dom = new DOMDocument;
$dom->loadHTML("<th>Country:</th><td>UAS <img src='www.site.com/image.png' /></td>");
echo $dom->getElementsByTagName('td')->item(0)->nodeValue;

It return only UAS without img tag.

Jonathan Drapeau
  • 2,610
  • 2
  • 26
  • 32
DolDurma
  • 15,753
  • 51
  • 198
  • 377

0 Answers0