Php can detect IP, hostname, client agent etc. Can php detect client browser monitor size/resolution?
You would have to pass that up to a PHP script from JavaScript like most tracking code does (with a transparent image request).
You'll have to use PHP together with JavaScript, like in this example.
No, it cant. PHP runs on the server, so it cant detect client settings unless you take specific client-side steps to pass the info to the PHP scripts on the server.
Please do note that some of us like our browsers non-maximized. Perhaps you'd be better off trying to detect browser size rather than screen resolution. I assume that the JS to do either would be very similar, but I don't actually know that to be the case.
Also, what is the resolution of a blind man's screen reader?
If you have to detect this it simply means your web application is broken.
Don't do it.
Note, that JS can check the window size of browser, but this size includes user toolbars, scrollbars etc... Real workspase area in browser depends on those toolbars size.
Several of you suggest that there is something wrong with trying to obtain a user's resolution. One in particular suggests that if you have to do this, then your application is broken.
There are so many unique circumstances and situations, that no one can possibly make this claim.
Don't be so eager to jump on someone who is doing something that YOU don't agree with.
Some people require browser size for mobile devoloping. This is essential information in some cases.
Using WURFL and WALL can get around this as most mobiles do not support JS.