title: reliable user browser detection with php
body: <p>Trying to detect a user's browser with PHP only, is $_SERVER['HTTP_USER_AGENT'] a reliable way? Should I instead opt for the <a href="http://php.net/manual/en/function.get-browser.php" rel="noreferrer">get_browser</a> function? which one do you find brings more precise results?</p>
  
  <p>If this method is pragmatic, is it ill advised to use it for outputting pertinent CSS links, for example:</p>
  
  <pre><code>if(stripos($_SERVER['HTTP_USER_AGENT'],"mozilla")!==false)
     echo '&lt;link type="text/css" href="mozilla.css" /&gt;';
  </code></pre>
  
  <p>I noticed <a href="https://stackoverflow.com/questions/1372332/php-display-messages-to-certain-browsers">this question</a>, however I wanted to clarify whether this is good for CSS-oriented detection.</p>
  
  <p><strong>UPDATE:</strong>
  something really suspicious: I tried <code>echo $_SERVER['HTTP_USER_AGENT'];</code> on IE 7 and this is what it output:</p>
  
  <blockquote>
    <p>Mozilla/4.0 (compatible; MSIE 7.0;
    Windows NT 6.0; SLCC1; .NET CLR
    2.0.50727; Media Center PC 5.0; .NET CLR 3.5.30729; .NET CLR 3.0.30618)</p>
  </blockquote>
  
  <p>Safari gave something weird with "mozilla" in it too. What gives?</p>