PHP code example of mikeevstropov / user-agent

1. Go to this page and download the library: Download mikeevstropov/user-agent library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

mikeevstropov / user-agent example snippets




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