Exemple #1
0
 static function getCountryCode()
 {
     $geoDatabase = json_decode(file_get_contents(self::$geoCookedPath));
     $currentIP = ip2long(self::$currentIP);
     foreach ($geoDatabase as $countryCode => $netblocks) {
         foreach ($netblocks as $netblock) {
             $from = $netblock[0];
             $to = $netblock[1];
             if ($currentIP >= $from && $currentIP <= $to) {
                 self::$currentCountry = $countryCode;
                 break 2;
             }
         }
     }
 }
Exemple #2
0
<?php

error_reporting(E_ALL);
ini_set('display_errors', 'On');
include '../iknore/iknore_master.php';
if (isset($_GET['hello'])) {
    //$ip = 183500926;
    //$b1 = $ip >> 24 & 255;
    //$b2 = $ip >> 16 & 255;
    //$b3 = $ip >> 8 & 255;
    //$b4 = $ip & 255;
    //
    //echo $b1 . '.' . $b2 . '.' . $b3 . '.' . $b4;
    IknoreMaster::initialize();
}