<?php $html = <<<HTML <script> console.log('<h1>aaa<\/h1>'); </script> HTML; $dom = new DOMDocument(); libxml_use_internal_errors(true); $dom->loadHTML(mb_convert_encoding($html, 'HTML-ENTITIES', "UTF-8"), LIBXML_HTML_NODEFDTD | LIBXML_HTML_NOIMPLIED); echo $dom->saveHTML();
You have javascript disabled. You will not be able to edit any code.