voy a ver esos links, pero encontre la solucion ideal, un metodo y lo hice clase:
esto le va a servir a todos:
Código PHP:
Ver originalclass utils_Browsers {
/*
* obtengo datos del navegador
*/
function getBrowser()
{
$u_agent = $_SERVER['HTTP_USER_AGENT'];
$bname = 'Unknown';
$platform = 'Unknown';
$version= "";
//First get the platform?
$platform = 'linux';
}
elseif (preg_match('/macintosh|mac os x/i', $u_agent)) { $platform = 'mac';
}
elseif (preg_match('/windows|win32/i', $u_agent)) { $platform = 'windows';
}
// Next get the name of the useragent yes seperately and for good reason
{
$bname = 'Internet Explorer';
$ub = "MSIE";
}
{
$bname = 'Mozilla Firefox';
$ub = "Firefox";
}
{
$bname = 'Google Chrome';
$ub = "Chrome";
}
{
$bname = 'Apple Safari';
$ub = "Safari";
}
{
$bname = 'Opera';
$ub = "Opera";
}
{
$bname = 'Netscape';
$ub = "Netscape";
}
// finally get the correct version number
$known = array('Version', $ub, 'other'); $pattern = '#(?<browser>' . join('|', $known) . ')[/ ]+(?<version>[0-9.|a-zA-Z.]*)#';
// we have no matching number just continue
}
// see how many we have
$i = count($matches['browser']); if ($i != 1) {
//we will have two since we are not using 'other' argument yet
//see if version is before or after the name
$version= $matches['version'][0];
}
else {
$version= $matches['version'][1];
}
}
else {
$version= $matches['version'][0];
}
// check if we have a number
if ($version==null || $version=="") {$version="?";}
'userAgent' => $u_agent,
'name' => $bname,
'version' => $version,
'platform' => $platform,
'pattern' => $pattern
);
}
}