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.