vchukh / ualibs
User-Agents liibrary
Installs: 31
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 0
Open Issues: 0
pkg:composer/vchukh/ualibs
Requires
- php: >=7.1
README
UaLibs is a simple PHP library for fetching User-Agent string for different browsers, like Chrome, Edge, Opera, Safari, Internet Explorer, Android Webkit.
It uses User-Agent data from next package: https://github.com/tamimibrahim17/List-of-user-agents.
Installation
Composer
Add ualibs in your composer.json or create a new composer.json:
{ "require": { "vchukh/ualibs": "^0.1" } }
Now tell composer to download the library by running the command:
$ php composer.phar install
Composer will generate the autoloader file automatically. So you only have to include this. Typically its located in the vendor dir and its called autoload.php
Basic Usage:
<?php $ualibs = new UaLibs(); var_dump($ualibs->get()); // get all available user agents var_dump($ualibs->getRandom()); // get random user-agent var_dump($ualibs->getChrome()); // get all available Chrome user agents var_dump($ualibs->getChromeRandom()); // get Chrome random user agent