00001 <?php
00002
00003 if (get_magic_quotes_gpc()) $html = stripslashes($_REQUEST['html']);
00004 else $html = $_REQUEST['html'];
00005
00006 if(strlen($html) > 0) {
00007
00008
00009 $config = array(
00010 'bare' => true,
00011 'clean' => true,
00012 'doctype' => 'strict',
00013 'drop-empty-paras' => true,
00014 'drop-font-tags' => true,
00015 'drop-proprietary-attributes' => true,
00016 'enclose-block-text' => true,
00017 'indent' => false,
00018 'join-classes' => true,
00019 'join-styles' => true,
00020 'logical-emphasis' => true,
00021 'output-xhtml' => true,
00022 'show-body-only' => true,
00023 'wrap' => 0);
00024
00025
00026 $tidy = new tidy;
00027 $tidy->parseString($html, $config, 'utf8');
00028 $tidy->cleanRepair();
00029
00030
00031 echo $tidy;
00032 } else {
00033
00034 echo ('0');
00035 }
00036 ?>