mirror of
https://github.com/ezyang/htmlpurifier.git
synced 2024-11-08 14:58:42 +00:00
Add sample test file which demonstrates basic usage.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@245 48356398-32a2-884e-a903-53898d9a118a
This commit is contained in:
parent
4cf7d4acfe
commit
4bf0398984
15
docs/examples/basic.php
Normal file
15
docs/examples/basic.php
Normal file
@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
// This file demonstrates basic usage of HTMLPurifier.
|
||||
|
||||
exit; // not to be called directly, it will fail fantastically!
|
||||
|
||||
set_include_path('/path/to/htmlpurifier/library' . PATH_SEPARATOR . get_include_path());
|
||||
require_once 'HTMLPurifier.php';
|
||||
|
||||
$purifier = new HTMLPurifier();
|
||||
$html = '<b>Simple and short';
|
||||
|
||||
$pure_html = $purifier->purify($html);
|
||||
|
||||
?>
|
Loading…
Reference in New Issue
Block a user