Are there any potential security risks associated with collecting user resolution data in PHP?

When collecting user resolution data in PHP, one potential security risk is the possibility of a Cross-Site Scripting (XSS) attack if the data is not properly sanitized. To mitigate this risk, it is important to sanitize the user input before storing or displaying it to prevent any malicious scripts from being executed.

// Sanitize user resolution data
$userResolution = htmlspecialchars($_POST['resolution']);