Browser detection is a thorny subject to say the least as headers can be manipulated, but a simple method of detection in php would like like this:
<?php
// get the User Agent
$user_agent = getenv("HTTP_USER_AGENT");
// check if identified as Internet Explorer
if (preg_match("/MSIE/i", $user_agent))
{
// do IE stuff
}
else
{
// do non ie stuff
}
?>