Are there any potential privacy concerns with displaying partial IP addresses in a web application?

Displaying partial IP addresses in a web application can potentially raise privacy concerns as it may reveal more information than intended. To address this issue, it is recommended to mask or anonymize the IP addresses before displaying them to users, such as by only showing the first few octets.

// Function to mask IP address
function maskIpAddress($ip) {
    $parts = explode('.', $ip);
    return $parts[0] . '.' . $parts[1] . '.xxx.xxx';
}

// Example of how to use the function
$ipAddress = '192.168.1.100';
$maskedIp = maskIpAddress($ipAddress);
echo $maskedIp; // Output: 192.168.xxx.xxx