Sanitation Class

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.

Quick Example

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

Stand-alone Example

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”.

Methods

sanitation.txt · Last modified: 2010/07/22 17:27 by davids
Back to top
CC Attribution-Share Alike 3.0 Unported
chimeric.de = chi`s home Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0