i prefer server-side because it will work the same everytime.
PHP Code:
<?
echo $_SERVER['HTTP_USER_AGENT'];
?>
then just pull up that page with different browsers and see what u get. it just returns a string. get creative on how you use those strings.