I am trying to loop through a series of p tags on a source page. Within each p tag there will be formatted text, e.g. <p>hello, my name is <b>bob</b></p>
I would like to each hello, my name is <b>bob</b>
but am currently only getting hello, my name is bob
without the <b>
tags.
I assume nodeValue is not the correct call but unsure what to use
$xpath = new DOMXPath($doc);
$row = $xpath->query('//div[@class="article-body"]/p');
foreach($row as $r) {
echo $r->nodeValue;
}