PHPackages                             apanly/browser-detector - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. apanly/browser-detector

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

apanly/browser-detector
=======================

根据UA判断浏览器类型和版本，操作系统，设备型号

302.7k↓100%10PHP

Since Apr 17Pushed 7y ago6 watchersCompare

[ Source](https://github.com/apanly/browser-detector)[ Packagist](https://packagist.org/packages/apanly/browser-detector)[ RSS](/packages/apanly-browser-detector/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

browser-detector
================

[](#browser-detector)

### 主要作用

[](#主要作用)

- 根据UA判断浏览器类型和版本，
- 根据UA判断操作系统和版本号
- 根据UA判断设备

### 检测支持

[](#检测支持)

#### 可检测浏览器

[](#可检测浏览器)

- QQ浏览器
- UC浏览器
- 百度浏览器
- 360浏览器
- 猎豹浏览器
- Vivaldi
- Opera
- Opera Mini
- WebTV
- Internet Explorer
- Pocket Internet Explorer
- Microsoft Edge
- Konqueror
- iCab
- OmniWeb
- Firebird
- Firefox
- Iceweasel
- Shiretoko
- Mozilla
- Amaya
- Lynx
- Safari
- Chrome
- Navigator
- GoogleBot
- Yahoo! Slurp
- W3C Validator
- BlackBerry
- IceCat
- Nokia S60 OSS Browser
- Nokia Browser
- MSN Browser
- MSN Bot
- Netscape Navigator
- Galeon
- NetPositive
- Phoenix
- SeaMonkey
- Yandex Browser
- Comodo Dragon

#### 可检测操作系统

[](#可检测操作系统)

- Windows
- Windows Phone
- OS X
- iOS
- Android
- Chrome OS
- Linux
- SymbOS
- Nokia
- BlackBerry
- FreeBSD
- OpenBSD
- NetBSD
- OpenSolaris
- SunOS
- OS2
- BeOS

#### 可检测设备

[](#可检测设备)

- iPad
- iPhone
- Windows Phone
- OPPO手机（OPPO）
- 红米手机（Redmi）
- 小米手机（XiaoMi）
- 乐视手机（Letv）
- Vivo手机（Vivo）
- 三星手机（Samsung）
- 华为手机（HuaWei）
- 联想手机（Lenovo）
- HTC
- 魅族手机（Meizu）
- 中兴手机（ZTE）
- 一加手机（ONEPLUS）

### 安装

[](#安装)

```
composer require apanly/browser-detector

```

### 使用

[](#使用)

```
use apanly\BrowserDetector\Browser;
use apanly\BrowserDetector\Os;
use apanly\BrowserDetector\Device;

$browser = new Browser();

if ($browser->getName() === Browser::IE && $browser->getVersion() < 11) {
    echo 'Please upgrade your browser.';
}

$os = new Os();

if ($os->getName() === Os::IOS) {
    echo 'You are using an iOS device.';
}

$device = new Device();

if ($device->getName() === Device::IPAD) {
    echo 'You are using an iPad.';
}

```

### 说明

[](#说明)

本项目大部分源码clone 参考资料的sinergi/php-browser-detector，主要是原项目无法适应中国国情，需要修改，故此另开一个项目

### Lecense

[](#lecense)

PHP Browser is licensed under [The MIT License (MIT)](LICENSE).

### 参考资料

[](#参考资料)

- [sinergi/php-browser-detector](https://github.com/sinergi/php-browser-detector)
- [用户代理检测和浏览器Ua详细分析](http://www.cnblogs.com/hykun/p/Ua.html)

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity29

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity37

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/50dc4cf4bbc2538609b9b36fa2f20dc08b039f175bf80a439e968ea50d79b250?d=identicon)[apanly](/maintainers/apanly)

---

Top Contributors

[![apanly](https://avatars.githubusercontent.com/u/1491556?v=4)](https://github.com/apanly "apanly (15 commits)")

### Embed Badge

![Health badge](/badges/apanly-browser-detector/health.svg)

```
[![Health](https://phpackages.com/badges/apanly-browser-detector/health.svg)](https://phpackages.com/packages/apanly-browser-detector)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
