What data can be extracted from a user's browser, such as screen resolution, using PHP?

To extract data from a user's browser, such as screen resolution, using PHP, you can utilize the $_SERVER superglobal array to access the HTTP_USER_AGENT and HTTP_ACCEPT_LANGUAGE headers. These headers contain information about the user's browser and can be used to determine the screen resolution.

<?php
$user_agent = $_SERVER['HTTP_USER_AGENT'];
$screen_resolution = $_SERVER['HTTP_ACCEPT_LANGUAGE'];

echo "User's browser: " . $user_agent . "<br>";
echo "Screen resolution: " . $screen_resolution;
?>