lfphp/ua

browser user agent resolver

0.0.2 2022-03-19 15:08 UTC

This package is auto-updated.

Last update: 2024-11-13 11:52:59 UTC


README

由于浏览器、系统、设备等不断更新,使用该库解析最新浏览器用户标识可能会出现错误识别等情况 如果有相关的问题,欢迎到 https://github.com/sasumi/ua 提issue,作者会尽快核实修复您 提到的问题。

快速入门

[安装]

composer require lfphp/ua

[使用]

use LFPhp\UA\Resolver\Browser;
use LFPhp\UA\Resolver\Device;

$ua = $_SERVER['HTTP_USER_AGENT'];
list($device, $vendor, $version, $type) = Device::resolve($ua);
var_dump($device, $vendor, $version, $type);
list($browser, $version) = Browser::resolve($ua);
var_dump($browser, $version);