PHP code example of pxgamer / log-browser-check
1. Go to this page and download the library: Download pxgamer/log-browser-check 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/ */
pxgamer / log-browser-check example snippets
use pxgamer\LogBrowserChecker\Config;
use pxgamer\LogBrowserChecker\IIS;
$config = new Config([
'session_column' => 7,
'ip_column' => 6,
'root_dir' => __DIR__ . '/logs',
'site_name' => 'test.com',
'ignored_ips' => ['127.0.0.1']
]);
$browserCheck = new IIS($config);
$browserCheck->findFiles();
$browserCheck->execute();
// Retrieve an array of browsers and their usage counts
$browserCheck->getBrowserStats();
// Retrieve an array of unique session ids
$browserCheck->getSessionsIds();
// Retrieve an array of unique user agents
$browserCheck->getUserAgents();