PHP Classes

MobileUserAgent: Extract information from mobile browser identifier

Recommend this page to a friend!
  Info   View files View files (4)   DownloadInstall with Composer Download .zip   Reputation   Support forum (4)   Blog    
Ratings Unique User Downloads Download Rankings
StarStarStar 57%Total: 5,132 All time: 516 This week: 206Up
Version License Categories
mobileuseragent 1.0.0GNU Lesser Genera...HTTP, PHP 5, Wireless and Mobile


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.

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

Innovation Award
PHP Programming Innovation award nominee
December 2004
Number 5

Prize: One subscription to the PDF edition of the magazine by PHP Architect
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.

With this information it is possible to determine which capabilities can be used to deliver content or provide services to each type of mobile device that accesses a Web site.

Manuel Lemos
Picture of Craig Manley
Name: Craig Manley <contact>
Classes: 5 packages by
Country: The Netherlands The Netherlands
Age: ???
All time rank: 2317 in The Netherlands The Netherlands
Week rank: 276 Down7 in The Netherlands The Netherlands Equal
Innovation award
Innovation award
Nominee: 4x

  Files folder image Files  
File Role Description
Plain text file detect_mobile_client.php Example Contains a function to detect if the visiting client is a mobile handset.
Accessible without login Plain text file MobileUserAgent.php Class The main class. Complete package with docs is available here:
Plain text file tmobileua.php Test Test script.
Plain text file unique_vendor_model_useragents.txt Output Unique tab seperated list of vendor, model, and the useragent they were extracted from.

 Version Control Unique User Downloads Download Rankings  
This week:0
All time:516
This week:206Up
User Ratings User Comments (1)
 All time