Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHP version of CSS Media Queries

Can't find anything on the web for this, wanted to throw the question out there.

Is the a PHP version of CSS Media Queries?

like image 367
Phill Pafford Avatar asked Apr 06 '11 17:04

Phill Pafford


2 Answers

I'm under the assumption that you would want to do this for the purpose of detecting mobile browsers - if not, then this answer is slightly irrelevant.

You can check out Mobile ESP for a mobile User Agent detection library. It's very simple to use and works well in my experiences.

like image 77
Sean Walsh Avatar answered Sep 24 '22 22:09

Sean Walsh


No, there isn't.

The browser doesn't send information on any of its media features to the server, so PHP doesn't have the information needed to implement this.

like image 24
Quentin Avatar answered Sep 26 '22 22:09

Quentin