The Sanitation class is a stand-alone library, which in terms means that it does not actually requires any other to function. The usage of this class is to sanitize data.
We are sanitizing a string to with the Sanitation::alnum method, to ensure that the data only consist of alpha-numerical characters.
// Initiate main class $Input = new Input; $name = 'John Doe %'; echo $Input->sanitize ('alnum', $name); // John Doe
This example shows how to validate data if you do not use the Input class.
// Initiate Sanitation class $Sanitize = new Sanitation; $data = 'abc1234%'; echo $Sanitize->alnum ($data);
As you might see – the output will be “abc1234”.