Browser Specific “Override” Stylesheets with PHP

I tried using the technique recommended in the comments, but couldn’t get it to work. Then I figured if I was going to be loading CSS override stylesheets for specific browsers, I might as well do it in the PHP instead and not pollute the HTML for working browsers.

This is brain-dead simple, but in case it saves someone else some time… this example is for IE 5.5:

if (strstr($_SERVER["HTTP_USER_AGENT"], 'MSIE 5.5')) {
  print('<link rel="stylesheet" type="text/css" '
       .'href="ie_55.css" />');