Don't add vimline to auto-generated files.
[htmlpurifier/darkodev.git] / docs / examples / basic.php
blobd9b99ba28b5e551795a29aabadf1219f296799de
1 <?php
3 // This file demonstrates basic usage of HTMLPurifier.
5 // replace this with the path to the HTML Purifier library
6 require_once '../../library/HTMLPurifier.auto.php';
8 $config = HTMLPurifier_Config::createDefault();
10 // configuration goes here:
11 $config->set('Core', 'Encoding', 'UTF-8'); // replace with your encoding
12 $config->set('HTML', 'Doctype', 'XHTML 1.0 Transitional'); // replace with your doctype
14 $purifier = new HTMLPurifier($config);
16 // untrusted input HTML
17 $html = '<b>Simple and short';
19 $pure_html = $purifier->purify($html);
21 echo '<pre>' . htmlspecialchars($pure_html) . '</pre>';
23 // vim: et sw=4 sts=4