Read screen width

Can you read the screen width on the fly. I am trying to make a responsive design which fits to the size of the browser width.

You could use CSS to make elements fit the browser width using

width: 100%

. A better choice would be to download Twitters Bootstrap Library which contains alot of helper classes for responsive design.

You could also do it with jQuery or native Javascript, although the CSS method is probably better.

There is no way to do this with PHP, as it is a server side language and has no interaction with the actual client (browser).