PHP code example of timeonegroup / udger-php

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

    

timeonegroup / udger-php example snippets


use Udger\ParserFactory;

rser object
$parser = ParserFactory::buildParserFromMySQL('mysql:host=db;dbname=udger;charset=UTF8', 'udger', 'udger');
$parser->setUA('Mozilla/5.0 (Windows NT 10.0; WOW64; rv:40.0) Gecko/20100101 Firefox/40.0');
$parser->setIP("66.249.64.73");

$ret = $parser->parse();

use Udger\ParserFactory;

rser object
$parser = ParserFactory::buildParserFromDataFile(sys_get_temp_dir() . '/udgercache/udgerdb_v3.dat');
$parser->setUA('Mozilla/5.0 (Windows NT 10.0; WOW64; rv:40.0) Gecko/20100101 Firefox/40.0');
$parser->setIP("66.249.64.73");

$ret = $parser->parse();
bash
composer 
bash
docker compose run --rm php ./vendor/bin/codecept run