PHP has no way of telling the screen resolution because it runs on the server. Javascript has a screen object which you can get the width and height from to calculate the aspect ratio.
I'm not 100% sure, but I think any screen resolution that gives you a ration of greater than 1.33:1 is widescreen.
1024/768 = 1.33 --> Not widescreen
1280/800 = 1.6 --> Widescreen
1920/1080 = 1.7 --> Widescreen
1920/720 = 2.67 --> Widescreen
Hope that helps.