fyre/useragent
Composer 安装命令:
composer require fyre/useragent
包简介
A user agent library.
README 文档
README
FyreUserAgent is a free, open-source user agent library for PHP.
Table Of Contents
Installation
Using Composer
composer require fyre/useragent
In PHP:
use Fyre\Http\UserAgent;
Basic Usage
$agentis a string representing the user agent.
$userAgent = new UserAgent($agent);
Alternatively, you can use the createFromString method for easier chaining.
$userAgent = UserAgent::createFromString($agent);
Methods
Get Agent String
Get the user agent string.
$agent = $userAgent->getAgentString();
Get Browser
Get the browser.
$browser = $userAgent->getBrowser();
Get Mobile
Get the mobile.
$mobile = $userAgent->getMobile();
Get Platform
Get the platform.
$platform = $userAgent->getPlatform();
Get Robot
Get the robot.
$robot = $userAgent->getRobot();
Get Version
Get the browser version.
$version = $userAgent->getVersion();
Is Browser
Determine whether the user agent is a browser.
$isBrowser = $userAgent->isBrowser();
Is Mobile
Determine whether the user agent is a mobile.
$isMobile = $userAgent->isMobile();
Is Robot
Determine whether the user agent is a robot.
$isRobot = $userAgent->isRobot();
统计信息
- 总下载量: 8.5k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 2
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-12-03