PHP Classes

UA String Parser: Parse browser user agent to extract their values

Recommend this page to a friend!
  Info   Documentation   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not yet rated by the usersTotal: 62 All time: 10,456 This week: 673Up
Version License PHP version Categories
ua-string-parser 1.0Custom (specified...5HTTP, PHP 5, Parsers
Description 

Author

This class can parse browser user agent to extract their values.

Picture of Peter Kahl
  Performance   Level  
Name: Peter Kahl <contact>
Classes: 37 packages by
Country: United Kingdom
Age: ???
All time rank: 41521 in United Kingdom
Week rank: 44 Up4 in United Kingdom Up
Innovation award
Innovation award
Nominee: 23x

Winner: 2x

Documentation

User Agent Parser

Downloads License If this project has business value for you then don't hesitate to support me with a small donation.

Parses UA strings of modern browsers.

Usage

use peterkahl\UAP\UAP;

$tmp = UAP::Parse('Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_4) AppleWebKit/537.36 (KHTML, like Gecko) Some loose text is here Chrome/67.0.3396.10 Safari/537.36');

var_dump($tmp);

/*
array(9) {
  ["UAP_OS_NAME"]=>
  string(5) "macOS"
  ["UAP_OS_VERSION"]=>
  string(7) "10.13.4"
  ["UAP_OS_LINUX"]=>
  bool(false)
  ["UAP_BR_NAME"]=>
  string(6) "Chrome"
  ["UAP_BR_VERSION"]=>
  string(12) "67.0.3396.10"
  ["UAP_HW_TYPE"]=>
  string(7) "desktop"
  ["UAP_HW_NAME"]=>
  string(9) "Macintosh"
  ["UAP_HW_BRAND"]=>
  string(5) "Apple"
  ["UAP_APPLE_BUILD"]=>
  string(0) ""
}

*/


  Files folder image Files (4)  
File Role Description
Files folder imagesrc (1 file)
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file LICENSE Lic. License text
Accessible without login Plain text file README.md Doc. Documentation

  Files folder image Files (4)  /  src  
File Role Description
  Plain text file UAP.php Class Class source

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  
 100%
Total:62
This week:0
All time:10,456
This week:673Up