JBZoo\Utils\Vars::isIn PHP Method

isIn() public static method

Return true if the number is within the min and max.
public static isIn ( integer | float $number, integer | float $min, integer | float $max ) : boolean
$number integer | float
$min integer | float
$max integer | float
return boolean
    public static function isIn($number, $min, $max)
    {
        return $number >= $min && $number <= $max;
    }

Usage Example

Beispiel #1
0
 public function testIn()
 {
     isTrue(Vars::isIn(0.5, 0, 5));
     isTrue(Vars::isIn(0.5, 0.5, 5));
     isFalse(Vars::isIn(0.5, 1, 5));
 }