PHP Secure Class to prevent XSS Attacks
Although this is not bullet proof but it would give you an idea on how to filter incoming data.
Copyleft : LGPL
Idea by: phpsec GROUP @ PHP|arch
Coded By: webKami

Version 1.0.1

1, Filters Cookie, Post and Get variables
2, A number of functions to filter integers floats etc

Version 1.0.2

1, Now accepts and filters array, look for $sub parameter
2, Improved testing
3, Supports filtering your own array / variables
4, Gives you a count of available variables in a certain parameter array