php htlm修复
使用DOMDocument进行html修复$htmlStr="<p>1111</p>"; $doc = new DOMDocument(); $doc->loadHTML(mb_convert_encoding($str, 'HTML-ENTITIES','UTF-8')); //获取html $html= $doc->saveHTML();
使用DOMDocument进行html修复$htmlStr="<p>1111</p>"; $doc = new DOMDocument(); $doc->loadHTML(mb_convert_encoding($str, 'HTML-ENTITIES','UTF-8')); //获取html $html= $doc->saveHTML();