In below HTML Code, I want to get the content of p tag
Example
<div class="body" style="text-align: justify;padding: 10px;">
<p style="text-align: justify;" dir="RTL">
...............
</p>
TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST
</div>
My current code is :
$dom = new DOMDocument;
$dom->loadHTML($content);
echo $dom->getElementsByTagName('div')->item(0)->childNodes;
Why this code isn't correct and how to resolve this issue.