PHP code example of pvpender / kagent

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

    

pvpender / kagent example snippets


use pvpender\KAgent\UserAgentParser;

$parser = new UserAgentParser();
$ua = $parser->parse();
echo $ua->platform();
echo $ua->browser();
echo $ua->browserVersion();

$parser = new UserAgentParser();
$ua = $parser->parse("Mozilla\/4.0 (compatible; MSIE 7.0; Windows NT 6.1; Trident\/3.1; Xbox)");
//it's work