'; function getFormMethod() { return (isset($_REQUEST['post'])) ? 'post' : 'get'; } if (empty($_REQUEST['strict'])) { ?> HTMLPurifier Live Demo

HTMLPurifier Live Demo

50000) { ?>

Request exceeds maximum allowed text size of 50kb.

set('Core', 'TidyFormat', !empty($_REQUEST['tidy'])); $config->set('HTML', 'Strict', !empty($_REQUEST['strict'])); $purifier = new HTMLPurifier($config); $pure_html = $purifier->purify($html); ?>

Here is your purified HTML:

Here is the source code of the purified HTML:

If you would like to validate the code with W3C's validator, copy and paste the entire demo page's source.

Welcome to the live demo. Enter some HTML and see how HTMLPurifier will filter it.

HTML Purifier Input ()

Warning: GET request method can only hold approximately 2000 characters. If you need to test anything larger than that, try the POST form.

Nicely format output with Tidy? />
XHTML 1.0 Strict output? />
Serve as application/xhtml+xml? (not for IE) />

Return to HTMLPurifier's home page. Try the form in GET and POST request flavors (GET is easy to validate, but POST allows larger inputs).

Valid XHTML 1.0 Transitional