public function anonymize($address) {
        $packedAddress = inet_pton($address);

        if (strlen($packedAddress) == 4) {
            return $this->anonymizeIPv4($address);
        } elseif (strlen($packedAddress) == 16) {
            return $this->anonymizeIPv6($address);
        } else {
            return "";
        }
    }
public function anonymize($address) {
        $packedAddress = inet_pton($address);

        if (strlen($packedAddress) == 4) {
            return $this->anonymizeIPv4($address);
        } elseif (strlen($packedAddress) == 16) {
            return $this->anonymizeIPv6($address);
        } else {
            return "";
        }
    }
public function anonymize ( $ address ) { $ packedAddress = inet_pton ( $ address ) ; if ( strlen ( $ packedAddress ) == 4 ) { return $ this -> anonymizeIPv4 ( $ address ) ; } elseif ( strlen ( $ packedAddress ) == 16 ) { return $ this -> anonymizeIPv6 ( $ address ) ; } else { return "" ; } }
Anonymize an IPv4 or IPv6 address.

@param $address string IP address that must be anonymized
@return string The anonymized IP address. Returns an empty string when the IP address is invalid.
Anonymize an IPv4 or IPv6 address .