https://github.com/guiliredu/simple-user-agent
Simple User Agent parser for PHP
https://github.com/guiliredu/simple-user-agent
php user-agent
Last synced: 6 months ago
JSON representation
Simple User Agent parser for PHP
- Host: GitHub
- URL: https://github.com/guiliredu/simple-user-agent
- Owner: guiliredu
- Created: 2018-11-13T17:25:24.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2021-11-02T06:38:22.000Z (over 4 years ago)
- Last Synced: 2025-09-14T21:44:09.666Z (10 months ago)
- Topics: php, user-agent
- Language: PHP
- Size: 12.7 KB
- Stars: 6
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Simple User Agent - PHP
A simple class to parse data from a user agent.
```php
setAgent('Mozilla/5.0 ...');
```
To get the data, you can call these available methods
```php
$agent->getAgent() // Full user agent string
$agent->getDevice() // iPhone
$agent->getOS() // iOS
$agent->getBrowser() // Apple Safari
$agent->getPrefix() // Safari
$agent->getVersion() // 11.0
$agent->getEngine() // WebKit
$agent->isBot() // true / false
$agent->getInfo() // Array with all the above info
```
---
This project is under development - For test purposes only
---
References:
- https://deviceatlas.com/blog/list-of-user-agent-strings
- https://developers.whatismybrowser.com/useragents/explore/