Printing the name of the browser using php
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/9693574/user-agent-extract-os-and-browser-from-string-php">User agent, extract OS and browser from string [PHP]</a>  </p>
</blockquote>



<p>I simply want to print the name of the browser that a user is using to visit a <code>php</code> page, using <code>php</code> itself. For this, I am doing</p>

<pre><code>&lt;?php
    echo $_SERVER['HTTP_USER_AGENT'];
?&gt;
</code></pre>

<p>But this prints the following when i am using Google Chrome</p>

<pre><code>Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.11 (KHTML, like Gecko) 
Chrome/23.0.1271.97 Safari/537.11
</code></pre>

<p>Why is this happening ? And how can I get the actual name of the browser using PHP ?</p>
