<?php
function browser ($comp) {
if(strstr($comp, "MSIE 7")) $browser = 'IE 7';
else if(strstr($comp, "MSIE 6")) $browser = 'IE 6';
else if(strstr($comp, "MSIE 5")) $browser = 'IE 5';
else if(strstr($comp, "MSIE 4")) $browser = 'IE 4';
else if(strstr($comp, "MSIE 3")) $browser = 'IE 3';
else if(strstr($comp, "Netscape 7")) $browser = 'Netscape 7';
else if(strstr($comp, "Netscape 6")) $browser = 'Netscape 6';
else if(strstr($comp, "Netscape 5")) $browser = 'Netscape 5';
else if(strstr($comp, "Netscape 4")) $browser = 'Netscape 4';
else if(strstr($comp, "Netscape 3")) $browser = 'Netscape 3';
else if(strstr($comp, "Gecko")) $browser = 'Mozilla';
else if(strstr($comp, "Opera")) $browser = 'Opera';
else if(strstr($comp, "Konqueror")) $browser = 'Konqueror';
else if(strstr($comp, "Galeon")) $browser = 'Galeon';
else if(strstr($comp, "Linx")) $browser = 'Linx';
else $browser = 'Other';
return $browser;
}
$agent = getenv("HTTP_USER_AGENT");
$browser = browser($agent);
?>
E' altamente configurabile quindi può fare al caso vostro.