Login   Register  
PHP Classes
elePHPant
Icontem

MobileUserAgent: Extract information from mobile browser identifier

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  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 (9 years ago) RSS 2.0 feedStarStarStar 57%Total: 5,061 This week: 1All time: 476 This week: 1,547Down
Version License Categories  
mobileuseragent 1.0.0GNU Lesser General Publ...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: 2134 in The Netherlands The Netherlands
Week rank: 1145 Down35 in The Netherlands The Netherlands Down
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,061All time:476
 This week:1This week:1,547Down
User Ratings User Comments (1)  
 All time
Utility:75%StarStarStarStar
Consistency:77%StarStarStarStar
Documentation:-
Examples:72%StarStarStarStar
Tests:50%StarStarStar
Videos:-
Overall:57%StarStarStar
Rank:1072