« Google launched Personalized Home for mobile phones | Main | MySpace Goes mobile »

Get Mobile User Agent using PHP

If you are looking for a solution to reconize the create personalized services for mobile websites for different mobile devices, you may find the Get Mobile User Agent PHP class very useful for you. This class parses user agent identifier strings from browsers used by mobile devices to extract relevant information. It recognizes many of the current mobile user agent identifier strings and processes them to extract their basic constituent parts, the most important being the mobile device vendor and model.

mobilephone.jpg

A useful application of this class is to use the extracted information to lookup vendor and model specific device characteristics in a database, or to detect if the visiting browser uses a certain type of mobile device. Of course you could use user agent profiles for this, but not all mobile phones have (valid) user agent profiles, especially the older types of mobile phones. This class was already verified to work correctly with over 2000 user agent strings.

The class was nominated for the phpclasses innovation award of December 2004 and this is the review of Manuel Lemos for this package : The possibilities of mobile devices like cellular phones and palmtops vary a lot depending on the type of device, brand and model characteristics. To take advantage of the possibilities of each type of device it is necessary to know which are the supported capabilities.

This class is capable of parsing the User-Agent identification string sent by the device browser application to the Web server. Then it extracts the relevant details that can be used to cross-check a database of device specific characteristics supplied by their vendors.

I find it really useful for example you open a website and it gives you menu to browse games for your mobile phone model, like : Find Games for 6630, Java Games, Find applications for 6630, Nokia applications ... etc. this will let the user go directly to pages specific to his mobile device while spending time in looking into other pages. And if the user want more options he can choose the other links.

Get Mobile User Agent class is very useful to develop mobile websites, released under LGPL license.

Bookmark this article at these sites
Comments
1

hi,

this is really a good idee :-)
thanks for this script

2

This was very much helpful for me track the correct package.
Good luck sir.

3

It should be noted that although this script is lightweight and fast, it only does some simple user agent parsing and will return the screen dimensions about 5-10% of the time, since they normally don't appear in modern user agents. Check out the post on WURFL, Wireless Universal Resource File if you want to detect tons of capabilities accurately - like MP3 support, or Animated GIF Wallpaper support, or Java support.

Post a comment





(Email will remain hidden)





Please enter the security code you see here




Related entries
Email to a friend
Email this article to:


Your email address:


Message (optional):