Forum Moderators: coopster
$dom = new DOMDocument();
libxml_use_internal_errors(true);
@$dom->loadHTMLFile("$url");
libxml_use_internal_errors(false);
$xpath = new DOMXpath($dom);
$divTag = $xpath->evaluate("//div[@id=intwrap]");
$divcontent = $divTag->item(0);
$content = $dom->saveXML($divcontent);
$content = str_replace(" ", "\r", $content);
$file = 'test.txt';
file_put_contents ($file, $content);
header('Location: test.txt');
$dom = new DOMDocument;
libxml_use_internal_errors(true);
$dom->loadHTMLFile("$url");
libxml_use_internal_errors(false);
$node = $dom->getElementById('intwrap');
echo $node->nodeValue;
$dom = new DOMDocument;
libxml_use_internal_errors(true);
$dom->loadHTMLFile("$url");
libxml_use_internal_errors(false);
$node = $dom->getElementById('intwrap');
$content = $dom->saveXML($node);
$content = str_replace(" ", "", $content);
$file = 'test.txt';
file_put_contents ($file, $content);
header('Location: test.txt');