如何用PHP修复脏的HTML代码
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了如何用PHP修复脏的HTML代码相关的知识,希望对你有一定的参考价值。
This php class lets you clean and repair html code. WHAT IT DOES: delete closed tags without their opening tag, fix open tag without close, closing them automatically, check bad nesting and fix them, fix bad quotes in attributes, merge different styles attributes in the same tag, remove html comments, remove empty tags and more bad tags.
/* download the class from: http://www.barattalo.it/html-fixer/ */ $dirty_html = ".....bad html here......"; $a = new HtmlFixer(); $clean_html = $a->getFixedHtml($dirty_html);
以上是关于如何用PHP修复脏的HTML代码的主要内容,如果未能解决你的问题,请参考以下文章