Php input validation and HTMLPurifier

i am looking for php input filter/validation class/package.

HTMLPurifier also looks good for filtering user input but i HTMLPurifier is not exactly i am looking for.

I am also building a class from a tutorial which will check for type of variable and its range and returns appropriate message if it fails.

i assume that i should pass variable through HTMLpurifier first and then do the validation.

please give your opinions


This recent blog post by Pádraic Brady should help.

In this article, I take a look at some of the solutions PHP developers rely upon to perform HTML Sanitisation. Mostly because few others have done it or written about such solutions in any great detail (at least publicly). HTML Sanitisation has a very low profile in PHP. It’s rarely mentioned, usually not understood all that well, and examining some of the solutions in this area with more deliberate attention is worth doing. Also, it’s valuable research since I am writing my own HTML Sanitisation library (bias alert!) for a future Zend Framework 2.0 proposal. Knowing what the competition is up to does no harm! Finally, I was simply curious. Nobody seems too pushed to look closely at all these HTML Sanitisation solutions despite the fact that there are other developers (I think) who wouldn’t touch most of them with a barge pole.

thanks for reply.

that is good article.
it taught me to look at filtration from other perspective also.