public static function ip_match($ip, $match)
    {
        if (ip2long($match)) {//is an actual IP
            if ($ip == $match) {
                return true;
            }
        } else {//is something weird
            if (strpos($match, '/')) {//if it's a cidr notation
                if (self::cidr_match($ip, $match)) {
                    return true;
                }
            } else {//is a random string (let's say a host name)
                $match = gethostbyname($match);
                if ($ip == $match) {
                    return true;
                } else {
                    return false;
                }
            }
        }
        return false;
    }