Giter VIP home page Giter VIP logo

useragentanalyzer's Introduction

UserAgentAnalyzer

MIT licensed

The browser/OS or robot detection by user agent.

Requirements

  • PHP 5.6.0+

Installation

composer require miovisman/useragentanalyzer

Example

$uaa = new UserAgentAnalyzer\UserAgentAnalyzer();

$ua = 'Mozilla/5.0 (Linux; Android 6.0.1; SM-T550 Build/MMB29M; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/51.0.2704.81 Safari/537.36 GSA/6.1.28.21.arm';
$result = $uaa->analyse($ua);
var_dump($result);

#array(8) {
#  ["isMobile"]=>       bool(true)
#  ["isRobot"]=>        bool(false)
#  ["botName"]=>        NULL
#  ["botVersion"]=>     NULL
#  ["browserName"]=>    string(15) "Android WebView"
#  ["browserVersion"]=> string(3) "4.0"
#  ["osName"]=>         string(7) "Android"
#  ["osVersion"]=>      string(5) "6.0.1"
#}

$ua = 'Mozilla/5.0 (compatible; DuckDuckGo-Favicons-Bot/1.0; +http://duckduckgo.com)';
$result = $uaa->analyse($ua);
var_dump($result);

#array(8) {
#  ["isMobile"]=>       NULL
#  ["isRobot"]=>        bool(true)
#  ["botName"]=>        string(23) "DuckDuckGo-Favicons-Bot"
#  ["botVersion"]=>     string(3) "1.0"
#  ["browserName"]=>    NULL
#  ["browserVersion"]=> NULL
#  ["osName"]=>         NULL
#  ["osVersion"]=>      NULL
#}

License

This project is under MIT license. Please see the license file for details.

useragentanalyzer's People

Contributors

miovisman avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

halojoy

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.