Oihana Php Masking

maskInteger.php

Table of Contents

Functions

maskInteger()  : int
Replaces a value with a random integer in `[lower, upper]`.

Functions

maskInteger()

Replaces a value with a random integer in `[lower, upper]`.

maskInteger([mixed $value = null ][, int $lower = -100 ][, int $upper = 100 ]) : int

Implements the conventional integer masker: the value is replaced whatever its original type (string, boolean and null included). The bounds are inclusive; they are swapped if given in the wrong order.

Parameters
$value : mixed = null

The original value (ignored — replaced wholesale).

$lower : int = -100

Smallest value to return.

$upper : int = 100

Largest value to return.

Tags
throws
RandomException
example
use function oihana\masking\maskInteger;

maskInteger( 9999 );          // e.g. 42   (default range -100..100)
maskInteger( 'x' , 0 , 10 );  // e.g. 7
since
1.0.0
author

Marc Alcaraz

Return values
int
On this page

Search results