title: Php : Finding Chrome and Safari Browsers
body: <p>I use below code to find user agent, 
      
  
  <pre><code>    $user_agent = $_SERVER['HTTP_USER_AGENT']; 
      if (preg_match('/MSIE/i', $user_agent)) { 
         echo "Internet Explorer";
      }
      if (preg_match('/Firefox/i', $user_agent)) { 
         echo "FireFox";
      }
      if (strpos( $user_agent, 'Chrome') !== false)
      {
          echo "Google Chrome";
      }
      if (strpos( $user_agent, 'Safari') !== false)
      {
         echo "Safari";
      }
      if (preg_match('/Opera/i', $user_agent)) { 
         echo "Opera";
      }
  
      ?&gt;
  </code></pre>
  
  <p>But my chrome browser returning below useragent suddenly</p>
  
  <pre><code>Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_4) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.155 Safari/537.22
  </code></pre>
  
  <p>It contains the word safari and chrome.so both the browser names are printed.what is the solution for this.thanks.</p>