2017 © Pedro Peláez
 

library ua-parser

User Agent Parser

image

dynamicart/ua-parser

User Agent Parser

  • Wednesday, October 14, 2015
  • by dynamicart
  • Repository
  • 1 Watchers
  • 0 Stars
  • 9 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 6 Versions
  • 0 % Grown

The README.md

User Agent Parser > UAParser

Parse any user agent string by PHP

  • Detect the device (mobile|tablet|smartTV|desktop or service)
  • The device contain the brand (like Samsung), and contain the phone or tablet type (like Prestigio PAP5400DUO).
  • Detect visitor Operation System like Windows, Linux, OSX, Android...
  • The OS info contain the OS version (like Windows NT5.1 or Android 4.2.2).
  • Detect visitor Browser/Client like Chrome, Firefox, Outlook...
  • The browser info contain tha browser or client version (like MSOffice 15 or Chrome 38...)

Usage

$UAP = new dynamicart\UAParser('Mozilla/5.0 (Linux; U; Android 5.0; hu-hu; LG-D855 Build/LRX21R.A1421812393) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30');
$UAP->getParsedData();

or, (*1)

$UAP = new dynamicart\UAParser();
$UAP->setUA('Mozilla/5.0 (Linux; U; Android 5.0; hu-hu; LG-D855 Build/LRX21R.A1421812393) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30');
$UAP->getParsedData();

License

The mobile/tablet/os/browser patterns based on Mobile Detect Library 2.8.17 (http://mobiledetect.net), but this was just the start point., (*2)

The patterns are continuously grow and change., (*3)

@author: János Szentgyörgyi puttocska@gmail.com, (*4)

@license: Code and contributions have 'MIT License' https://github.com/dynamicart/UAParser/blob/master/LICENSE, (*5)

GitHub Repo: https://github.com/dynamicart/UAParser, (*6)

What's new

@version: 0.2.0 + smartTV detection + pattern updates + recheck the detected device, if parsed device is 'desktop' and parsed OS is not desktopOS, then device set to 'mobile', (*7)

version: 0.1.3 + mobile & tablet patterns updated, + mobile patterns are sorted, + device type is fixed, (*8)

Warning

This script version is very early! Don't trust in the result..., (*9)

The Versions

14/10 2015

dev-master

9999999-dev

User Agent Parser

  Sources   Download

MIT

parser detector mobile ua

14/10 2015

0.2.0

0.2.0.0

User Agent Parser

  Sources   Download

MIT

parser detector mobile ua

09/10 2015

0.1.3

0.1.3.0

User Agent Parser

  Sources   Download

MIT

parser detector mobile ua

09/10 2015

0.1.2

0.1.2.0

User Agent Parser

  Sources   Download

MIT

parser detector mobile ua

06/10 2015

0.1.1

0.1.1.0

User Agent Parser

  Sources   Download

MIT

parser detector mobile ua

06/10 2015

0.1.0

0.1.0.0

User Agent Parser

  Sources   Download

MIT

parser detector mobile ua