Detect on which browser current web application is running
<p>I wanted to know in PHP, how to detect on which browser my web application is running. </p>

<p>e.g. </p>

<p>If current browser is chrome then alert("Chrome browser processing") otherwise alert("rest browser processing");</p>

<pre><code>echo $_SERVER['HTTP_USER_AGENT'];
</code></pre>

<p>Below output I am getting If i execute above code :</p>

<pre><code>Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/532.0 (KHTML, like Gecko) Chrome/3.0.195.21 Safari/532.0
</code></pre>

<p>Please suggest your pointers to detect exact browser name.</p>

<p>Thanks,</p>

<p>-Pravin</p>
