Longman\IPTools\Ip::processWithAsterisk PHP Method

processWithAsterisk() protected static method

Checks if an IP is part of an IP range.
protected static processWithAsterisk ( string $range ) : boolean
$range string IP range specified in one of the following formats: Wildcard format: 1.2.3.* OR 2001:cdba:0000:0000:0000:0000:3257:*
return boolean true if IP is part of range, otherwise false.
    protected static function processWithAsterisk($range)
    {
        if (strpos($range, '*') !== false) {
            $lowerRange = self::$isv6 ? '0000' : '0';
            $upperRange = self::$isv6 ? 'ffff' : '255';
            $lower = str_replace('*', $lowerRange, $range);
            $upper = str_replace('*', $upperRange, $range);
            $range = $lower . '-' . $upper;
        }
        if (strpos($range, '-') !== false) {
            return self::processWithMinus($range);
        }
        return false;
    }