PHP code example of nidear1024 / useragentparsed
1. Go to this page and download the library: Download nidear1024/useragentparsed 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/ */
nidear1024 / useragentparsed example snippets
$str = "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:106.0) Gecko/20100101 Firefox/106.0";
$str = getallheaders()['User-Agent'];
$obj = new \Common\Tools\UserAgentParsed();
echo "<pre>";
var_dump($obj->getBrowserInfo($str));
var_dump($obj->getSystemOS($str));
var_dump($obj->checkSpider($str));
var_dump($obj->getMachineType($str));
var_dump($obj->getAllInfo($str));
die;
sh
cd useragentparsed
php ./test/index.php