Hi, i am using DOM to get content of div tag but inner html part is not shown. Function is:
$dom = new DOMDocument;
libxml_use_internal_errors(true);
$dom->loadHTMLFile("$url");
libxml_use_internal_errors(false);
$xpath = new DOMXPath($dom);
$divTag = $xpath->query('//div[@id="post"]');
foreach ($divTag as $val) {
echo $val->getAttribute('title') . ' - ' . $val->nodeValue . "<br />\n";
}
if source of page is (just for Div)
<div id="post">Some text <img src="..." /> <table>some codes</table></div>
then function returns just
"Some text "
but i want to get all HTML elements too, like that:
Some text <img src="..." /> <table>some codes</table>
Is there any way to do it? Thanks right now.