An open API service indexing awesome lists of open source software.

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

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/