PHP Classes
elePHPant
Icontem

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    
Last Updated Ratings Unique User Downloads Download Rankings
2004-12-21 (11 years ago) RSS 2.0 feedStarStarStar 59%Total: 5,104 This week: 1All time: 491 This week: 1,047Down
Version License Categories
mobileuseragent 1.0.0GNU Lesser Genera...HTTP, PHP 5, Wireless and Mobile
Description Author

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
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: http://sourceforge.net/projects/mobileuseragent/
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  
 0%
Total:5,104
This week:1
All time:491
This week:1,047Down
User Ratings User Comments (1)
 All time
Utility:77%StarStarStarStar
Consistency:79%StarStarStarStar
Documentation:-
Examples:75%StarStarStarStar
Tests:54%StarStarStar
Videos:-
Overall:59%StarStarStar
Rank:1215