Tidy Tool

" />



Errors and warnings:"; if ( $_POST[html] ) { $html = stripslashes($_POST[html]); $tidy = tidy_parse_string($html); } /* preg_match used to prevent exposing your own PHP */ elseif ( $_GET[url] && preg_match( "#^http.+$#i", "$_GET[url]", $x ) ) { $html = trim($_GET[url]); $html = file_get_contents($html); $tidy = tidy_parse_string($html); } $tidy->CleanRepair(); $tidy->diagnose(); $output = tidy_get_error_buffer($tidy); $output = htmlentities($output); $output = nl2br($output); $output = str_replace( "
", "

", $output); $output = str_replace( "Warning:", "Warning:", $output); $output = preg_replace( "#(line \d+ column \d+)#", "$1", $output); echo "$output"; echo "

"; echo "

Cleaned HTML

"; echo "
"; echo ""; echo "
"; } else { echo "
\n

Enter a URL or HTML. HTML errors will be listed and the script will attempt to repair the errors. Warning: WebTV propietary tags or attributes may be removed!
\n
"; } ?>