This package is a part of Shieldon Firewall 2.
Use PHP Composer:
composer require shieldon/web-security
Or, download it and include the Shieldon autoloader.
require 'autoload.php';
$xss = new \Shieldon\Security\Xss();
$_POST['username'] = 'javascript:/*--></title></style></textarea></script></xmp><svg/onload=\'+/"/+/onmouseover=1/+/[*/[]/+alert(1)//\'>';
$username = $xss->clean($_POST['username']);
echo $username;
result
[removed]/*--></title></style></textarea>[removed]</xmp><svg/[removed]>
$xss = new \Shieldon\Security\Xss();
$_GET = $xss->clean($_GET);
MIT