View Single Post
Old 02-25-2009, 02:45 PM   #2 (permalink)
Talking BlackBerry Encyclopedia
Join Date: Apr 2005
Location: Los Angeles, CA USA
Model: 9000
Carrier: AT&T
Posts: 209
Post Thanks: 0
Thanked 0 Times in 0 Posts

If their Browser Identification is set as Blackberry then the user agent string is usually formatted like this:

BlackBerry8900/ Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/100
BlackBerry9000/ Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/107
BlackBerry9530/ Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/105

but they could have their Browser Identification set to Firefox or Internet Explorer and then it will not contain any Blackberry specific info.

For the Blackberry user agents above, I use this in PHP:

if (preg_match('/BlackBerry[^\/]*\/(.+) Profile/i', $agent, $matches))
and then for the above user agents
$matches[1] =
$matches[1] =
$matches[1] =
Offline   Reply With Quote