2017 © Pedro Peláez
 

library php-useragent

A User-agent analyze project.

image

zsxsoft/php-useragent

A User-agent analyze project.

  • Friday, June 15, 2018
  • by zsx
  • Repository
  • 11 Watchers
  • 73 Stars
  • 3,884 Installations
  • PHP
  • 2 Dependents
  • 2 Suggesters
  • 27 Forks
  • 2 Open issues
  • 7 Versions
  • 13 % Grown

The README.md

PHP-UserAgent

Build Status Latest Stable Version Codacy Badge Packagist, (*1)

A User-agent analyze project., (*2)

Try it

http://www.zsxsoft.com/php-useragent/test-my-useragent.php, (*3)

JavaScript Edition

https://github.com/zsxsoft/useragent.js/ , (*4)

Contributors

zsx(http://www.zsxsoft.com), (*5)

The project is based on kyleabaker's "wp-useragent"., (*6)

Supported Browsers/Platforms

Click here to see full list., (*7)

Tested Browsers: Amazon Silk / Android Webkit / Avant Browser / Comodo Dragon / curl / Firefox / Google Chrome / Internet Explorer / Microsoft Edge / Links / Lynx / Maxthon / MxNitro / Opera / QQBrowser / Safari SRWare Iron / Teleca Q7 / UC Browser / Vivaldi / W3M / wget / Yandex.Browser and so on.., (*8)

OS: Android / Arch Linux / CentOS / Chrome OS / Debain / Fedora / FreeBSD / OSX / Red Hat / openSUSE / SymbianOS / Unix / Palm webOS / Windows 3.1 - 10 / Ubuntu / Linux and so on.., (*9)

Devices: Xiaomi / BlackBerry / Nexus / HTC / Huawei / Kindle / Lenovo / LG / Motorola / Nokia / OnePlus / PlayStation / Samsung / Sony Xperia / ZTE / Ubuntu / Windows Phone / Apple Family and so on., (*10)

Example & API


 * @license GNU/GPL http://www.gnu.org/copyleft/gpl.html
 */
ini_set('display_errors', 'On');
error_reporting(E_ALL);
include './useragent.class.php';
$useragent = UserAgentFactory::analyze($_SERVER['HTTP_USER_AGENT']);
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>UserAgent</title>
</head>
<body>
    <h1>Test UserAgent</h1>
    <p>UserAgent: <?php echo $useragent->useragent; ?></p>
    <p>Platform Type: <?php echo $useragent->platform['type'] ?>
    <p>Device: <img src="<?php echo $useragent->device['image'] ?>"/><?php echo $useragent->device['title'] ?>(Brand: <?php echo $useragent->device['brand'] ?>, Model: <?php echo $useragent->device['model'] ?>) </p>
    <p>OS: <img src="<?php echo $useragent->os['image'] ?>"/><?php echo $useragent->os['title'] ?> (Name = <?php echo $useragent->os['name'] ?>, Version = <?php echo $useragent->os['version'] ?>)</p>
    <p>Browser: <img src="<?php echo $useragent->browser['image'] ?>"/><?php echo $useragent->browser['title'] ?> (Name = <?php echo $useragent->browser['name'] ?>, Version = <?php echo $useragent->browser['version'] ?>)</p>

</body>
</html>

TODO

  • Move out RegExps like useragent.js from the PHP file

License

  • @license GNU/GPL http://www.gnu.org/copyleft/gpl.html

The Versions

15/06 2018

dev-master

9999999-dev

A User-agent analyze project.

  Sources   Download

GPL

The Requires

  • php >=5.2

 

The Development Requires

by Avatar zsx

15/06 2018

1.5

1.5.0.0

A User-agent analyze project.

  Sources   Download

GPL

The Requires

  • php >=5.2

 

The Development Requires

by Avatar zsx

04/01 2017

1.4

1.4.0.0

A User-agent analyze project.

  Sources   Download

GPL

The Requires

  • php >=5.2

 

The Development Requires

by Avatar zsx

17/04 2016

1.3

1.3.0.0

A User-agent analyze project.

  Sources   Download

GPL

The Requires

  • php >=5.2

 

The Development Requires

by Avatar zsx

10/04 2016

1.2

1.2.0.0

A User-agent analyze project.

  Sources   Download

GPL

The Requires

  • php >=5.2

 

The Development Requires

by Avatar zsx

11/03 2016

1.1

1.1.0.0

A User-agent analyze project.

  Sources   Download

GPL

The Requires

  • php >=5.2

 

The Development Requires

by Avatar zsx

25/02 2015

1.0

1.0.0.0

A simple project that allows you to display details about a computer's operating system or web browser with a user-agent.

  Sources   Download

GPL

The Requires

  • php >=5.2

 

The Development Requires

by Avatar zsx