public static function iPMatch($ip1, $ip2)
    {
        $objIP1 = IP::parse($ip1);

        $objIP2 = Range::parse($ip2);

        return $objIP2->contains($objIP1);
    }
public static function iPMatch($ip1, $ip2)
    {
        $objIP1 = IP::parse($ip1);

        $objIP2 = Range::parse($ip2);

        return $objIP2->contains($objIP1);
    }
public static function iPMatch ( $ ip1 , $ ip2 ) { $ objIP1 = IP :: parse ( $ ip1 ) ; $ objIP2 = Range :: parse ( $ ip2 ) ; return $ objIP2 -> contains ( $ objIP1 ) ; }
determines whether IP address ip1 matches the pattern of IP address ip2, ip2 can be an IP address or a CIDR pattern.

@param string $ip1
@param string $ip2

@return bool

@throws \Exception
determines whether IP address ip1 matches the pattern of IP address ip2 ip2 can be an IP address or a CIDR pattern .