Return to Snippet

Revision: 23316
at February 4, 2010 03:58 by ginoplusio

Initial Code
  download the class from:

$dirty_html = ".....bad html here......";

$a = new HtmlFixer();
$clean_html = $a->getFixedHtml($dirty_html);

Initial URL

Initial Description
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.

Initial Title
How to fix dirty HTML code with PHP

Initial Tags
php, html, code

Initial Language