loadHTML($page); $title = $doc->getElementsByTagName('title')[0]->textContent; ?> <?= $title ?> -- Superstack ' . $title . ''; echo '

' . $site . ''; echo ' [orig]

'; $content = $doc->getElementsBytagName('div'); foreach ($content as $el) { if (stripos($el->getAttribute('class'), 'body') !== false) { $ret = new DOMDocument(); $node = $ret->importNode($el, true); $ret->appendChild($node); echo $ret->saveHTML(); // echo $el->nodeValue; // echo ''; // echo '' . $el->getAttribute('class') . ''; // echo '' . stripos($el->getAttribute('class'), 'body') . ''; // echo ''; } } ?>