Oh, crap! What a friggin headache!
I guess I would still minimize the number of calls and try to work out a regex solution. Something like:
if (preg_match('!Opera[/ ]?(\d*)!', $agent, $matches)) // opera. Version is in $matches[1]
{
...
}
else if (preg_match('!MSIE[/ ]?(\d*)!', $agent, $matches)) //IE. Version is in $matches[1]
{
}
else if (preg_match('!Mozilla[/ ]?(\d*)!', $agent, $matches)) // You get the idea
{
}
else // None of the above -- "safe"
{
}
Take care,
Nik
http://www.bigaction.org/