sanitizer() function

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.

Please note this method is and thus not intended to be called directly.

Example

$clean = sanitizer()->pageName($dirty); // regular syntax
$clean = sanitizer('pageName', $dirty); // shortcut syntax

Internal usage

// basic internal usage
$sanitizer = sanitizer();

// internal usage with all arguments
$sanitizer = sanitizer(string $name = '', string $value = '');

Arguments

NameType(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.251