I'm not sure if this is the best way to do it or is what you mean, but here go's:
code:
<?php
$browser = $_SERVER['HTTP_USER_AGENT'];
if (preg_match("/firefox/i", "$browser")) {
$result = "Mozilla Firefox";
}
elseif (preg_match("/ie/i", "$browser")) {
$result = "Internet Explorer";
}
elseif (preg_match("/opera/i", "$browser")) {
$result = "Opera";
}
else {
$result = "Unknown";
}
echo "<strong>$result</strong>";
?>
(note: I've only done some examples, you can expand it for others such as Netscape if you want.)