Get Mobile User Agent using PHP

Written by on January 28, 2006 in Mobile websites - 4 Comments

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

4 Comments on "Get Mobile User Agent using PHP"

  1. domain January 29, 2006 at 11:55 am · Reply

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

  2. Razib Ahmed July 11, 2007 at 9:50 am · Reply

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

  3. Steve Kamerman July 25, 2007 at 4:34 pm · Reply

    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.

  4. Jame_2d March 2, 2010 at 7:22 am · Reply

    I really dont understand why they still using that kind of mobile phone for browsing internet..

Leave a Comment