PHP to get the particular div content from loadHTML()
by Subramanian[ Edit ] 2014-02-21 12:55:21
PHP to get the particular div content from loadHTML() :
The following php code is used to get the particular div content from html code.
$dom = new DOMDocument();
$dom->loadHTML($html);
$xpath = new DOMXPath($dom);
$div = $xpath->query('//div[@id="main_content"]');
$div = $div->item(0);
$mainCOn= $dom->saveXML($div);