Skip to content

Instantly share code, notes, and snippets.

@maxout
Created January 16, 2014 13:49
Show Gist options
  • Save maxout/8455258 to your computer and use it in GitHub Desktop.
Save maxout/8455258 to your computer and use it in GitHub Desktop.
Parse HTML-Body
<?php
$d = new DOMDocument;
$mock = new DOMDocument;
$d->loadHTML(file_get_contents('http://www.telekom-stiftung.de/dts-cms/de/mobile-newsarchiv'));
$body = $d->getElementsByTagName('body')->item(0);
foreach ($body->childNodes as $child){
$mock->appendChild($mock->importNode($child, true));
}
echo $mock->saveHTML();
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment