PHP can't directly, but JavaScript can. You can then have JavaScript pass the info back to PHP. But you'd have this:
user loads site -> JavaScript determines screen width/height and sends request back to server for PHP -> PHP works its magic and send new page back
The user ends up making 2 page calls for this to work. If you have a splash page, then this is fine. If you don't, then you'll need to get creative (such as just making it a JavaScript solution instead of a PHP one).