PHP code example of khalilleo-webagentur / browser-detect

1. Go to this page and download the library: Download khalilleo-webagentur/browser-detect 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/ */

    

khalilleo-webagentur / browser-detect example snippets



$userAgent = new UserAgent();

$userAgent->getBrowserName();
$userAgent->getBrowserLang();
$userAgent->getPlatform();
$userAgent->getReferer();
$userAgent->isMobile();
$userAgent->isBot();




use Khalilleo\BrowserDetect\UserAgent;

Agent->getBrowserName()); // output: Mozilla Firefox
var_dump($userAgent->getPlatform()); // output: linux
var_dump($userAgent->getBrowserLang()); // output: en
var_dump($userAgent->getReferer()); // output: Unknown
var_dump($userAgent->isMobile()); // output: false
var_dump($userAgent->isBot()); // output: false