trgino / random-user-agent
Random user agent generator in PHP.
Installs: 33
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:package
Requires
- php: >=5.4
- ext-json: *
README
Installation
To install Random_UA
you can either clone this repository or you can use composer
composer require trgino/random-user-agent
Usage
namespace RandomAgent; require_once __DIR__.'/vendor/autoload.php'; $rand_ua = Random_UA::random(); /* or */ $rand_ua = Random_UA::random([ 'category' => 'desktop', ]); /* or */ $rand_ua = Random_UA::random([ 'category' => ['desktop'], ]); /* or */ $rand_ua = Random_UA::random([ 'category' => ['desktop'], 'platform' => ['windows','mac'], ]);
/* or */
$rand_ua = Random_UA::random([ 'category' => ['desktop'], 'platform' => ['windows','mac'], 'vendor' => ['chrome'], ]);
Available Device Categories
-----
```php
namespace RandomAgent;
require_once __DIR__.'/vendor/autoload.php';
print_r(Random_UA::getCategories());
/*
Array
(
[0] => desktop
)
*/
Available Platforms
namespace RandomAgent; require_once __DIR__.'/vendor/autoload.php'; print_r(Random_UA::getPlatforms()); /* Array ( [0] => Windows [1] => Mac ) */