$sanitizer->min() method

Sanitize value to be at least the given $min 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

NameType(s)Description
valueint, 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.125

Twitter updates

  • New post: This week we take a look at what’s in ProcessWire 3.0.126 which focuses largely on resolving issue reports, but also includes a handy new Page if() method— More
    15 February 2019
  • New post: ProcessWire 3.0.125 has several useful new Sanitizer methods & options, plus new ways to access them directly from the Input API variable. This makes handling user input even easier than before. Plus updates to our i18n functions & API docs— More
    25 January 2019
  • New post: In this week’s post, we’ll take a look a look at the new website and focus on some parts of it and how they were built. Then we’ll dive into the latest version of ProcessWire on the dev branch, version 3.0.124— More
    11 January 2019

Latest news

  • ProcessWire Weekly #249
    In the 249th issue of ProcessWire Weekly we're going to walk you through the latest core updates (ProcessWire 3.0.126), introduce a new third party module called Page Access Releasetime, and pick a new site of the week. Read on!
    Weekly.pw / 16 February 2019
  • ProcessWire 3.0.126 core updates
    This week we take a look at what’s in ProcessWire 3.0.126 which focuses largely on resolving issue reports, but also includes a handy new $page->if() method. 
    Blog / 15 February 2019
  • Subscribe to weekly ProcessWire news

“Yesterday I sent the client a short documentation for their ProcessWire-powered website. Today all features already used with no questions. #cmsdoneright—Marc Hinse, Web designer/developer