- libxml_use_internal_errors: documentation ( source)
<?php
$xmlString = "
<html>
<head><title><![CDATA[Mooooo]]></title>
<bar>Moo
";
$dom = new DOMDocument();
$dom->strictErrorChecking = false;
libxml_use_internal_errors(true);
$dom->loadHTML($xmlString, LIBXML_NOCDATA );
echo $dom->saveXML();