How to saveHTML of DOMDocument without HTML wrapper?
All of these answers are now wrong, because as of PHP 5.4 and Libxml 2.6 loadHTML now has a $option parameter which instructs Libxml about how it should parse the content. Therefore, if we load the HTML with these options $html->loadHTML($content, LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD); when doing saveHTML() there will be no doctype, no <html>, and … Read more