PHP code example of ornicar / php-user-agent
1. Go to this page and download the library: Download ornicar/php-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/ */
ornicar / php-user-agent example snippets
php
$userAgent = new phpUserAgent();
$userAgent->getBrowserName() // firefox
$userAgent->getBrowserVersion() // 3.6
$userAgent->getOperatingSystem() // linux
$userAgent->getEngine() // gecko
php
// include classes or rely on Composer autoloader
ingParser.php';
// Create a user agent
$userAgent = new phpUserAgent();
// Interrogate the user agent
$userAgent->getBrowserName() // firefox
$userAgent->getBrowserVersion() // 3.6
$userAgent->getOperatingSystem() // linux
$userAgent->getEngine() // gecko
bash
$ php prove.php