PHP code example of larryli / ipv4-medoo

1. Go to this page and download the library: Download larryli/ipv4-medoo 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 / ipv4-medoo example snippets


$medoo = new \larryli\ipv4\medoo\Database([
    'database_type' => 'sqlite',
    'database_file' => __DIR__ . '/ipv4.sqlite',
]);
$monipdb = new \larryli\ipv4\MonipdbQuery(__DIR__ . '/17monipdb.dat');
if (!$monipdb->exists()) {
    $monipdb->init();
}
$qqwry = new \larryli\ipv4\QqwryQuery(__DIR__ . '/qqwry.dat');
if (!$qqwry->exists()) {
    $qqwry->init();
}
$your_query = new \larryli\ipv4\FullQuery($medoo);
if (!$your_query->exists()) {
    $your_query->init(null, $monipdb, $qqwry);
}
$your_query->find(ip2long('127.0.0.1'));