- Sanitization
-
-
-
- in package
-
-
-
-
-
-
-
-
- Simple PHP Sanitization Class
- - - - -- Tags - -
- - - - - - - -- Table of Contents - -
- --
-
- - $data - - : mixed - -
- The value of the malicious string you want to sanitize - -
- - __construct() - - : mixed - -
- PhpSanitization Class Constructor - -
- - esc() - - : mixed - -
- Like Codeigniter sanatize an associative array, a sequential array or a string - -
- - isAssoc() - - : bool - -
- Check if the provided array is an associative or a sequential array - -
- - sanitize() - - : string - -
- Sanitize value - -
- Properties - -
-- $data - - - -
- - -The value of the malicious string you want to sanitize
- -
- private
- mixed
- $data
-
-
-
-
-
-
-- Methods - -
-- __construct() - -
- - -PhpSanitization Class Constructor
- -
- public
- __construct([mixed $data = null ]) : mixed
-
-
-
- Parameters
--
-
- - $data - : mixed - = null -
-
-
- -The value of the malicious string you want to sanitize
-
-
Return values
- mixed - — - - - -- esc() - -
- - -Like Codeigniter sanatize an associative array, a sequential array or a string
- -
- public
- esc([mixed $data = null ]) : mixed
-
-
-
- Parameters
--
-
- - $data - : mixed - = null -
-
-
- -The value of the malicious string you want to sanitize
-
-
Return values
- mixed - — -Return a sanitized string, array, or associative array
-- isAssoc() - -
- - -Check if the provided array is an associative or a sequential array
- -
- private
- isAssoc(array<string|int, mixed> $arr) : bool
-
-
-
- Parameters
--
-
- - $arr - : array<string|int, mixed> - -
-
-
- -The array you want to check it's type
-
-
Return values
- bool - — -Return true if provided array is an associative or false otherwise
-- sanitize() - -
- - -Sanitize value
- -
- private
- sanitize(string $value) : string
-
-
-
- Parameters
--
-
- - $value - : string - -
-
-
- -The value of the malicious string you want to sanitize
-
-
Return values
- string - — -Return the sanitized string
-