PHP code example of guiliredu / simple-user-agent

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

    

guiliredu / simple-user-agent example snippets




impleUserAgent\UserAgent;

$agent = new UserAgent();


$agent = new UserAgent('Mozilla/5.0 ...');

$agent->setAgent('Mozilla/5.0 ...');

$agent->getAgent() // Full user agent string
$agent->getDevice() // iPhone
$agent->getOS() // iOS
$agent->getBrowser() // Apple Safari
$agent->getPrefix() // Safari
$agent->getVersion() // 11.0
$agent->getEngine() // WebKit
$agent->isBot() // true / false
$agent->getInfo() // Array with all the above info