Io per il mio script uso questo:

Codice PHP:
<?php 
function agent($browser) {
  
$useragent $_SERVER['HTTP_USER_AGENT'];
  return 
strstr($useragent$browser);
  }
  
  function 
os($opersys) {
  
$oper $_SERVER['HTTP_USER_AGENT'];
  return 
strstr($oper$opersys);
  }
//firefox
if(agent('Firefox/2') != FALSE) {
    
$br 'Firefox 2';
}

elseif(
agent('Firefox/1.5') != FALSE) {
    
$br 'Firefox 1.5';
}

elseif(
agent('Firefox') != FALSE) {
    
$br 'Firefox';
}

elseif(
agent('GranParadiso') != FALSE) {
    
$br 'Firefox GranParadiso';
}
//AOL
else if(agent('America Online Browser') != FALSE) {
    
$br 'AOL';
}
//opera
else if(agent('Opera 5') != FALSE) {
    
$br 'Opera 5';
}
else if(
agent('Opera/5') != FALSE) {
    
$br 'Opera 5';
}
else if(
agent('Opera/6') != FALSE) {
    
$br 'Opera 6';
}
else if(
agent('Opera 6') != FALSE) {
    
$br 'Opera 6';
}
else if(
agent('Opera/7') != FALSE) {
    
$br 'Opera 7';
}
else if(
agent('Opera 7') != FALSE) {
    
$br 'Opera 7';
}
//opera

else if(agent('Safari') != FALSE) {
    
$br 'Safari';
}
//Internet Explorer
else if(agent('MSIE 2') != FALSE) {
    
$br 'Internet Explorer 2';
}
else if(
agent('MSIE 3') != FALSE) {
    
$br 'Internet Explorer 3';
}
else if(
agent('MSIE 4') != FALSE) {
    
$br 'Internet Explorer 4';
}
else if(
agent('MSIE 5') != FALSE) {
    
$br 'Internet Explorer 5.5';
}
else if(
agent('MSIE 6') != FALSE) {
    
$br 'Internet Explorer 6.0';
}
else if(
agent('MSIE 4.5') != FALSE) {
    
$br 'Internet Explorer 4.5';
}
else if(
agent('MSIE 5.5') != FALSE) {
    
$br 'Internet Explorer 5.5';
}
else if(
agent('MSIE 7') != FALSE) {
    
$br 'Internet Explorer 7.0';
}
//Internet Explorer
else if(agent('Lynx') != FALSE) {
    
$br 'Lynkx';
}
else if(
agent('Links') != FALSE) {
    
$br 'Links';
}
else if(
agent('amaya') != FALSE) {
    
$br 'Amaya';
}
else if(
agent('Konqueror') != FALSE) {
    
$br 'Konqueror';
}
else if(
agent('Epiphany') != FALSE) {
    
$br 'Epiphany';
}
else if(
agent('Galeon') != FALSE) {
    
$br 'Galeon';
}
else if(
agent('Avant Browser') != FALSE) {
    
$br 'Avant Browser';
}
else if(
agent('Wget') != FALSE) {
    
$br 'Wget';
}
else if(
agent('Firebird') != FALSE) {
    
$br 'Firebird';
}
else if(
agent('Netscape') != FALSE) {
    
$br 'Netscape';
}


    if(
os('Windows NT 5.1') != FALSE) {
    
$os 'Windows XP';
    }
    elseif(
os('Windows') != FALSE) {
    
$os 'Windows';
    }
      elseif(
os('Linux') != FALSE) {
    
$os 'Linux';
    }
      elseif(
os('MAC') != FALSE) {
    
$os 'MAC OSX';
    }

echo 
"Browser: $br  OS: $os";
?>