Sanitize variables and related string functions ($sanitizer API variable as a function)
This behaves the same as the $sanitizer
API variable but supports arguments as optional shortcuts.
Example
$clean = sanitizer()->pageName($dirty); // regular syntax
$clean = sanitizer('pageName', $dirty); // shortcut syntax
Usage
// basic usage
$sanitizer = sanitizer();
// usage with all arguments
$sanitizer = sanitizer(string $name = '', string $value = '');
Arguments
Name | Type(s) | Description |
---|---|---|
name (optional) | string | Optionally enter a sanitizer function name |
value (optional) | string | If $name populated, enter the value to sanitize |
Return value
Sanitizer
string
int
array
null
mixed
Functions methods and properties
API reference based on ProcessWire core version 3.0.236