title: Conundrum - need to get viewport size in PHP (or any other way around it)
body: <p>Basically, I currently have a site that's written in javascript, but I've decided to rewrite in mainly PHP. The main bit I'm replacing uses spry to read values off an xml dataset into javascript variables.</p>
  
  <p>PHP with mySQL can easily take on the jobs I'm using spry for, but there's one other part of the script I'd like to make server-side.</p>
  
  <p>What currently goes on is that as the page loads, my function decides what size a picture should be, and therefore what size to get on the server. There are five files of different sizes, and it chooses the smallest one where it doesn't have to upscale (but it can downscale). It combines this with some information from spry, and sets the src of an img element, which is not previously set (this is part of what I hate about my current setup).</p>
  
  <p>I've done my googling, and I know the problem - PHP parses server-side, at that point it can't know the screen size.</p>
  
  <p>I can do without - I would either keep my existing javascript for this task, which is a bit unstable, or just use one size of image, which would just make my site not as good.</p>
  
  <p>I'm just wondering if any expert has a trick up their sleeves for having php decide which image to embed. I'm guessing there's nothing the browser sends when it first requests the site.. that woulda showed up in my googling..</p>
  
  <p>I should mention, I've not done any PHP apart from a simple thing where there's a tab bar on all pages of my site, and I use php to bring it in and change the appearance of the selected tab.</p>