21
function getUserAgent(){
//AcBbCc/2.0/F605i/c20/TB/W20H10/serXXXXX000000 -->this is the match for the 1st one.. I have no problem with this.
if (preg_match("/AcBbCc\/[0-9\.]+[\/ ]([A-Za-z0-9]+)/", $_SERVER['HTTP_USER_AGENT'], $agent)) {
return $agent[1];
//ABCD-ZS24 UP.Browser/6.2.0.4 (GUI) MMP/2.0 -->this is my problem, I'm confused with the ('-') and the whitespace
}else if if (preg_match("/KDDI(-[A-Za-z0-9]$))\/", $_SERVER['HTTP_USER_AGENT'], $agent)) {
return $agent[1];
}else{
//
return "IE";
}
}
please help..
thanks..