Mozilla or Internet explorer

Mozilla or Internet explorer

<?php
$useragent = getenv("HTTP_USER_AGENT");

if (preg_match("/MSIE/i", "$useragent"))
{
$result = "Internet Explorer.";
}

else if (preg_match("/Mozilla/i", "$useragent"))
{
$result = "Mozilla";
}

else
{
$result = "You are using $useragent";
}
?>
<HTML>
<HEAD>
<TITLE>Browser Match Results</TITLE>
</HEAD>
<BODY>
<?php echo "<P>$result</P>"; ?>
</BODY>
</HTML>