mikeevstropov/user-agent

This package is abandoned and no longer maintained. No replacement package was suggested.

The library provides a user agent string

1.0.0 2017-06-21 04:54 UTC

This package is not auto-updated.

Last update: 2022-09-03 17:23:12 UTC


README

The library provides a user agent string

Installation

Add dependency mikeevstropov/user-agent

$ composer require mikeevstropov/user-agent

Usage

<?php

use Mikeevstropov\UserAgent\UserAgent;

// Getting of a desktop user agent
$desktopUserAgent = UserAgent::getDesktopRand();

gettype($desktopUserAgent); // string

// Getting of a mobile user agent
$mobileUserAgent = UserAgent::getMobileRand();

gettype($mobileUserAgent); // string

Api Interface

  • getDesktopRand

    Get a random desktop user agent

    Returns:

    • string
  • getMobileRand

    Get a random mobile user agent

    Returns:

    • string

Development

Clone

$ git clone https://github.com/mikeevstropov/user-agent

Go to project

$ cd user-agent

Install dependencies

$ composer install

Run the tests

$ composer test

License

MIT