21
sayuri
Re: Need help from Regular Expression Guru
  • 2004/6/29 1:52

  • sayuri

  • Just popping in

  • Posts: 1

  • Since: 2004/6/29


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..

Login

Who's Online

137 user(s) are online (104 user(s) are browsing Support Forums)


Members: 0


Guests: 137


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Apr 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits