$sanitizer->intUnsigned() method

Sanitize to unsigned (0 or positive) integer

This is an alias to the int() method with default min/max arguments.

Usage

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

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

Arguments

NameType(s)Description
valuemixed
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

int

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.127

Twitter updates

  • New post: This week ProcessWire ProMailer has been released, plus we’ve got a nice upgrade in our community support forum, and more— More
    15 March 2019
  • New post: This week we look at the latest version of ProcessWire, 3.0.127 with nearly 30 new commits resolving dozens of older issue reports and a couple useful new features— More
    1 March 2019
  • 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

Latest news

  • ProcessWire Weekly #253
    In the 253rd issue of ProcessWire Weekly we'll introduce the ProMailer Pro module, cover the upgrade made to our support forum software, check out Sanitizer Transliterate, and pick a new site of the week. Read on!
    Weekly.pw / 16 March 2019
  • ProcessWire ProMailer now available
    This week ProcessWire ProMailer has been released, plus we’ve got a nice upgrade in our community support forum, and more.
    Blog / 15 March 2019
  • Subscribe to weekly ProcessWire news

“ProcessWire is like a breath of fresh air. So powerful yet simple to build with and customise, and web editors love it too.” —Margaret Chatwin, Web developer