Answers for "fixing unclosed html tags"

PHP
0

fixing unclosed html tags

$str = "
<html>
 <head>
  <title>test</title>
 </head>
 <body>
  <p>error</i>
 </body>
</html>
";

$doc = new DOMDocument();
@$doc->loadHTML($str);
echo $doc->saveHTML();
Posted by: Guest on October-07-2021

Browse Popular Code Answers by Language