how to get user's screen resolution with PHP [duplicate] how to get user's screen resolution with PHP [duplicate] php php

how to get user's screen resolution with PHP [duplicate]


You need JavaScript, not PHP.

var screenWidth = window.screen.width,    screenHeight = window.screen.height;

You can then send it to the server via Ajax (with an XmlHttpRequest).

See also the MDC window.screen docs.


You can't, not in php. PHP is strictly server-side.


you can't get it server-side, you have to get it client-side with javascript with innerWidth. you can pass it to the server-side with AJAX if you need to.