字符长度验证
@param $value
@param $min
@param $max
@return bool
191597
protected function lengthValidate($value, $min, $max)
    {
        return $min <= mb_strlen($value) && mb_strlen($value) <= $max;
    }
789202
public static function isBetween($value, $min, $max, $inclusive = false)
    {
        \settype($min, 'int');
        \settype($max, 'int');
        \settype($inclusive, 'bool');

        $length = \mb_strlen($value, \mb_detect_encoding($value));

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

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

        return $min <= $length && $length <= $max;
    }
73889
public static function getRandom($min,$max){
		if($min === null)
			$min = 0;
		if($max === null)
			$max = 1;
		return mt_rand($min, $max);
	}
1114621
public static function number($val, $min = null, $max = null, $flags = 0): bool
    {
        if (!\is_numeric($val)) {
            return false;
        }

        if ($val <= 0) {
            return false;
        }

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

        return ($length <= $max && $length >= $min);
    }
1297389
public static function randNum($min = null, $max = null)
    {
        mt_srand((double) microtime() * 1000000);
        if ($min === null || $max === null) {
            return mt_rand();
        } else {
            return mt_rand($min, $max);
        }
    }
505103
public function countArray($min, $max = PHP_INT_MAX)
    {
        return $this->markErrorIf(!is_array($this->value)||count($this->value) < $min || count($this->value) > $max, false);
    }
23981
public static function RAND($min = 0, $max = 0)
    {
        $min = PHPExcel_Calculation_Functions::flattenSingleValue($min);
        $max = PHPExcel_Calculation_Functions::flattenSingleValue($max);

        if ($min == 0 && $max == 0) {
            return (mt_rand(0, 10000000)) / 10000000;
        } else {
            return mt_rand($min, $max);
        }
    }
495543
public static function isLt($value, $min)
    {
        is_array($min) && $min = $min[0];
        if (!is_numeric($value)) {
            return false;
        } elseif (function_exists('bccomp')) {
            return bccomp($min, $value, 14) == 1;
        } else {
            return $value < $min;
        }
    }
1284050
public function vBetween(Int $min = 0, Int $max = 0)
    {
        return $this->setJavascriptValidation
        (
            'ZNValidationBetween', 
            ['betweenBoth' => [':p1' => $min, ':p2' => $max]],
            ['betweenBoth' => [$min, $max]],
            [$min, $max]  
        );
    }
41810
public function rule_between( $key, $value, $min, $max )
	{
		return $this->rule_between_num( $key, strlen( $value ), $min, $max );
	}
1356664
public function setMinMax($min,$max=null)
    {
       $this->min = $min; 
       $this->max = $max; 
    }
525251
protected static function _rand($min, $max)
    {
        if (version_compare(PHP_VERSION, '7.0.0', 'ge')) {
            $value = random_int($min, $max);
        } else {
            $value = mt_rand($min, $max);
        }

        return $value;
    }
970070
public static function between($min, $max): Compare
    {
        $value = $min > $max ? [$max, $min] : [$min, $max];
        return new Compare('bt', $value);
    }
1064054
public function length($min, $max = null) {
        if (!$this->_isValid) {
            return $this;
        }
        $length = mb_strlen($this->_unsafeVar, $this->conf['encoding']);
        if ($length < $min || (!is_null($max) && $length > $max)) {
            $this->_isValid = false;
        }
        return $this;
    }
805214
public function between($min, $max) {
        $this->check_role = 'between';
        $this->p1 = $min;
        $this->p2 = $max;
        $result = $this->value >= $min && $this->value <= $max;
        $this->checkResult($result);
        return $this;
    }
960950
protected function keep_within($value, $min, $max) {
        if ($value < $min) {
            return $min;
        }
        if ($value > $max) {
            return $max;
        }
        return $value;
    }