PHP Classes


Recommend this page to a friend!
  Classes of Peter Kahl  >  UA String Parser  >  >  Download  
Role: Documentation
Content type: text/markdown
Description: Documentation
Class: UA String Parser
Parse browser user agent to extract their values
Author: By
Last change: Update
Date: 2 years ago
Size: 1,142 bytes


Class file image Download

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.


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');


array(9) {
  string(5) "macOS"
  string(7) "10.13.4"
  string(6) "Chrome"
  string(12) "67.0.3396.10"
  string(7) "desktop"
  string(9) "Macintosh"
  string(5) "Apple"
  string(0) ""


For more information send a message to info at phpclasses dot org.