This class lets you quickly sanitize the request array and make it ready to store in the database. This is my first try at OOP PHP so there may be many issues with standards and concepts. I will appreciate your incredible contribution.
- Installation
- Initialization
- Sanitize Request Array
- MySQL Escape Array Elements
- Both Sanitize And Escape Array Elements
- Sanitize String
- MySQL Escape String
- Both Sanitize And Escape String
require_once ('DataSanitizer.php');
$clean = new DataSanitizer($_REQUEST);
Sanitize HTML in array element
$clean->sanitizeArrayHtml();
Mysql escape array elements
$clean->sqlEscapeArray();
Both sanitize and escape array elements
$clean->sanitizeAndSqlEscArray();
Alternative to htmlspecialchars();
$clean->sanitizeStr($str);
Alternative to addslashes();
$clean->sqlEscapeStr($str);
Both sanitize and Escape string
$clean->sanitizeAndSqlEscString($str);
I need your contribution. Your contribution will make me learn from you and will make me more passionate about this community. Thanks!! :D