I know there are several ways to get the screen size by javascript, etc. but I have not found a satisfactory way to get this size to PHP BEFORE loading the screen.
For example, I would like the HTML / PHP file below to get the width of the screen somehow in the% PHP $largura_tela
variable:
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<?php echo $largura_tela; ?>
</body>
</html>