Sanitized an integer (unsigned, unless you specify a negative minimum value)


// basic usage
$int = $sanitizer->int(mixed $value);

// usage with all arguments
$int = $sanitizer->int(mixed $value, array $options = []);



Value you want to sanitize as an integer

$options (optional)array

Optionally specify any one or more of the following to modify behavior:

  • min (int|null): Minimum allowed value (default=0)
  • max (int|null): Maximum allowed value (default=PHP_INT_MAX)
  • blankValue (mixed): Value that you want to use when provided value is null or blank string (default=0)

Return value


Returns integer, or specified blankValue (which doesn't necessarily have to be an integer)

$sanitizer methods and properties

API reference based on ProcessWire core version 3.0.115