Return to Snippet

Revision: 11558
at February 9, 2009 05:21 by stancell

Initial Code
function tidy_html($html)
    $tidy_config = array(
        'clean' => true,
        'output-xhtml' => true,
        'show-body-only' => true,
        'word-2000' => true,
        'show-body-only' => true,

    $tidy = new tidy();
    $tidy->parseString($html, $tidy_config, 'utf8');
    return tidy_get_output($tidy);

Initial URL

Initial Description
Cleans up HTML using tidy. Returns only <body> part. Set show-body-only to false if you want full document.

Initial Title
Clean up HTML with Tidy

Initial Tags

Initial Language