Whether a number $n falls in the range between $min and $max

@param int $n
@param int $min
@param int $max
@param bool $inclusive Whether to include $min and $max in the range
@return bool
15237
public static function between($n, $min, $max, $inclusive = true){
		
		if($inclusive){
			return static::greaterThanOrEqualTo($n, $min) &&
					static::lessThanOrEqualTo($n, $max);
		}
		
		return static::greaterThan($n, $min) &&
				static::lessThan($n, $$max);
		
	}
1055075
public static function size($val, $min = null, $max = null): bool
    {
        if (!\is_int($val)) {
            if (\is_string($val)) {
                $val = Helper::strlen(\trim($val));
            } elseif (\is_array($val)) {
                $val = \count($val);
            } else {
                return false;
            }
        }

        return self::integer($val, $min, $max);
    }
73889
public static function getRandom($min,$max){
		if($min === null)
			$min = 0;
		if($max === null)
			$max = 1;
		return mt_rand($min, $max);
	}
1357447
public static function isRequiredFloatRange($value, $min, $max)
    {
        return is_float($value) && $min <= $value && $max >= $value;
    }
279426
public static function range($min = 0, $max = -1)
    {
        for ($i = $min; $max < 0 || $i < $max; ++$i) {
            yield $i;
        }
    }
395521
public function range(int $min=null, int $max=null)
        {
                $min      = is_null($min) ? '-inf' : $min;
                $max      = is_null($max) ? '+inf' : $max;
           
                $response = $this->_redis->zrevrangebyscore($this->_key, $max, $min, 'WITHSCORES');
                $result   = [];
                for($i=0,$num=count($response);$i<$num;$i++) {
                        $result[$response[$i]] = intval($response[++$i]);
                }
                return $result;
        }
1066752
public function valueBetween($field, $min, $max, $inclusive = false)
    {
        $fieldValue = $this->get($field);

        $valid = ($fieldValue <= $max && $fieldValue >= $min);

        if (!$inclusive) {
            $valid = ($fieldValue < $max && $fieldValue > $min);
        }

        return ($valid === true) ?: $this->error($field, __FUNCTION__);
    }
749967
public static function isOptionalNumberRange($value, $min, $max)
    {
        /* No additional validations when the value is null. */
        if (null === $value) {

            return true;
        }

        return self::isRequiredNumberRange($value, $min, $max);
    }
72396
public static function between($input, $min, $max) {
        $length = mb_strlen($input);

        return ($length <= $max && $length >= $min);
    }
209097
public static function ruleLenRange($min, $max)
    {
        return function ($input) use ($min, $max) {
            return strlen($input) >= $min && strlen($input) <= $max;
        };
    }
1085780
public static function wrap($n, $min, $max) {
        return ($n >= $min && $n < $max) ? $n : (self::mod($n - $min, $max - $min) + $min);
    }
1342742
public static function isBetween($value, $min, $max, $inclusive = false)
    {
        \settype($value, 'int');
        \settype($min, 'int');
        \settype($max, 'int');

        if ($min > $max) {
            throw new \InvalidArgumentException(\sprintf('%s cannot be less than %s for validation', $min, $max));
        }

        if (false === $inclusive) {
            return (($value > $min) && ($value < $max));
        }

        return (($value >= $min) && ($value <= $max));
    }
960532
public static function integer($min=NULL,$max=NULL,$prompt=NULL){
		if(\is_int($min) && \is_int($max))
			return new Rule("integer[{$min}..{$max}]",$prompt);
		return new Rule("integer",$prompt);
	}
297970
public function minMax($min, $max=PHP_INT_MAX){
        return $this->markErrorIf($this->value < $min || $this->value > $max);
    }
215855
public function deleteByRank(int $min, int $max): int
    {
        return $this->handle->zRemRangeByRank($this->name, $min , $max );
    }
1247391
public function between($min, $max, $includeMin = true, $includeMax = true) {
        if (!$this->_isValid) {
            return $this;
        }

        if ($this->_unsafeVar < $min) {
            $this->_isValid = false;
        } else if ($this->_unsafeVar > $max) {
            $this->_isValid = false;
        } else if ($this->_unsafeVar == $min && !$includeMin) {
            $this->_isValid = false;
        } else if ($this->_unsafeVar == $max && !$includeMax) {
            $this->_isValid = false;
        }
        return $this;
    }
357086
public static function int($value, $min = null, $max = null)
    {
        // 最小值
        if(null !== $min && $value < $min)
        {
            return false;
        }
        // 最大值
        if(null !== $max && $value > $max)
        {
            return false;
        }
        // 整数验证
        return ((int)$value) == $value;
    }