PHP code example of larryli / monipdb

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

    

larryli / monipdb example snippets


$monipdb = new \larryli\monipdb\Monipdb('17monipdb.datx');
// or $monipdb = new \larryli\monipdb\Monipdb('17monipdb.dat', false);

// find
echo "202.103.24.68: {$monipdb['202.103.24.68']}\n";

// dump
echo count($monipdb) . "\n";

for foreach ($monipdb as $ip => $name) {
    echo "{$ip}: $name\n";
}