Sanitize to have a minimum value
If float or decimal string specified for $min argument, return value will be a float, otherwise an integer is returned.
Available since version 3.0.125.
Example
$n = 10;
$sanitizer->min(100); // returns 100
$sanitizer->min(5); // returns 10
$sanitizer->min(1.0); // returns 10.0
Usage
// basic usage
$int = $sanitizer->min($value);
// usage with all arguments
$int = $sanitizer->min($value, $min = -9223372036854775808);
Arguments
Name | Type(s) | Description |
---|---|---|
value | int, float, string | |
min (optional) | int, float, string | Minimum allowed value |
Return value
int
float
See Also
$sanitizer methods and properties
API reference based on ProcessWire core version 3.0.236