Download the PHP package flycro/ua-parser-modern-php without Composer
On this page you can find all versions of the php package flycro/ua-parser-modern-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download flycro/ua-parser-modern-php
More information about flycro/ua-parser-modern-php
Files in flycro/ua-parser-modern-php
Package ua-parser-modern-php
Short Description PHP port of ua-parser-modern - detect browser, engine, OS, CPU and device from User-Agent strings
License MIT
Homepage https://github.com/flycro/ua-parser-modern-php
Informations about the package ua-parser-modern-php
ua-parser-modern-php
PHP port of ua-parser-modern - detect Browser, Engine, OS, CPU, and Device type/model from User-Agent strings.
All regex patterns are ported 1:1 from the original JavaScript source to ensure identical detection behavior.
Requirements
- PHP 8.2+
ext-mbstring
Installation
Usage
Parse everything at once
Parse individual components
Only parse what you need:
JSON serialization
All result objects implement JsonSerializable:
Convert to array
Result Types
All results are readonly value objects:
| Method | Return Type | Properties |
|---|---|---|
parse() |
ParseResult |
ua, browser, device, engine, os, cpu |
parseBrowser() |
BrowserResult |
name, version, major |
parseDevice() |
DeviceResult |
model, type, vendor |
parseEngine() |
EngineResult |
name, version |
parseOS() |
OSResult |
name, version |
parseCPU() |
CPUResult |
architecture |
Testing
Credits
This is a PHP port of ua-parser-modern by Anthony Fu, which was forked from my-ua-parser by Matteo Collina, which was a fork of ua-parser-js by Faisal Salman.
License
The MIT License (MIT). Please see License File for more information.
All versions of ua-parser-modern-php with dependencies
ext-mbstring Version *