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 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.