title: Detect ie10, < ie10 and other browsers in php
body: <p>I have this code to detect if user is using IE Browser, however I would like to detect if it is ie 10 or a version below ie 10</p>
  
  <pre><code>&lt;?php
      $u_agent = $_SERVER['HTTP_USER_AGENT'];
      if(preg_match('/MSIE/i',$u_agent)){
         //do something
         //HOW TO KNOW IS IE 10
         // HOW TO KNOW BROWSER VERSION IS LESS THAN IE 10?
      }else{
         //hope users would always use other browser than IE 
      } 
  
      ?&gt;
  </code></pre>
  
  <p>so is it correct?</p>
  
  <pre><code> &lt;?php
          $u_agent = $_SERVER['HTTP_USER_AGENT'];
          //IE
          if(preg_match('/MSIE/i',$u_agent)){
  
             //IE 10
             if(preg_match('/msie 10/i', $_SERVER['HTTP_USER_AGENT'])) {
                       //  DO IE10.
             // &lt; IE 10
             }else{
                       //  DO &lt; IE10.
             } 
  
          }else{
             //OTHER BROWSERS 
             //hope users would always use other browser than IE 
          } 
  
          ?&gt;
  </code></pre>