Example #1
0
 function test_getCountryIdByIP()
 {
     foreach ($this->ips as $ip => $expected) {
         $rv = fbGeoIP_Free_Ascii::getCountryIdByIP($ip);
         $this->assertEquals($expected, $rv, "ip='{$ip}'");
     }
 }
Example #2
0
 function getCountryNameByIP($ip)
 {
     include_once FREEBEER_BASE . '/lib/ISO3166.php';
     $cc = fbGeoIP_Free_Ascii::getCountryIdByIP($ip);
     $rv = fbISO3166::getCountryName($cc);
     return $rv ? $rv : $cc;
 }