PHP Classes

MobileUserAgent: Extract information from mobile browser identifier

Recommend this page to a friend!
     
  Info   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
StarStarStar 57%Total: 5,133 All time: 516 This week: 63Up
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
Age: ???
All time rank: 2317 in The Netherlands The Netherlands
Week rank: 227 Up3 in The Netherlands The Netherlands Up
Innovation award
Innovation award
Nominee: 4x

  Files folder image Files (4)  
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.

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 0%
Total:5,133
This week:0
All time:516
This week:63Up
User Ratings User Comments (1)
 All time
Utility:75%StarStarStarStar
Consistency:77%StarStarStarStar
Documentation:-
Examples:72%StarStarStarStar
Tests:54%StarStarStar
Videos:-
Overall:57%StarStarStar
Rank:1580