- Output for 5.4.2 - 5.4.45, 5.5.24 - 5.5.29, 5.6.7 - 5.6.13
- Parse error: syntax error, unexpected ')' in /in/7CKrp on line 7
Process exited with code 255.
<?php
$html = '<h2>Bar</h2><p>lorem ipsum</p>';
$dom = new \DomDocument();
$dom->loadHTML( $html, LIBXML_HTML_NODEFDTD );
$html = '';
foreach( $dom->getElementsByTagName('body')[0] )->childNodes as $node ) {
$html .= $dom->saveHTML( $node );
}
var_dump( $html );