PHP code example of campo / random-user-agent

1. Go to this page and download the library: Download campo/random-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/ */

    

campo / random-user-agent example snippets


echo \Campo\UserAgent::random([
    'os_type' => ['Android', 'iOS'],
    'device_type' => ['Mobile', 'Tablet']
]), "\n";
 php
echo \Campo\UserAgent::random(), "\n";
 php
echo \Campo\UserAgent::random([
    'os_type' => 'Windows',
    'device_type' => 'Mobile'
]), "\n";