> 
> **Possible Duplicate:**  
> 
> [Determine Browser’s Version](https://stackoverflow.com/questions/7967008/determine-browsers-version) 
> 
> 
> 

I want to determine the browser type in the server code. 

As it is, I am spending too much time hacking the **HTML/CSS** to get the site to display consistently across all browsers. The only browser in which the site is rendered differently (incorrectly), is IE, so I want to notify the users so that they understand why the pages are not as they would expect.

To this end, I am only interested in detecting requests from IE, so that I can inform IE users that the site is best viewed using another web browser.

I believe that the browser type is sent in one of the HTTP headers as part of the GET request. I am thinking of using this in my logic. Is there a better way?

A code snippet will be very useful. something along the lines of:

```
<?php
 $flag = $_GET(SOME_VARIABLE); // check if it is ANY IE version
?>

```