1.  SxGeo.php  SxGeo.dat ( SxGeoCity.dat    http://sypexgeo.net/ru/download/)  

2.   SxGeo.php   ,  
include("SxGeo.php"); 

3.   SxGeo
//   -     (   Sypex Geo)
//   -  : 
//  SXGEO_FILE   (   ,   ); 
//  SXGEO_BATCH  ( ,      
//                IP  );
//  SXGEO_MEMORY (   ,     , 
//                   ,      ).

$SxGeo = new SxGeo(); //   ,   SxGeo.dat
//$SxGeo = new SxGeo('SxGeo.dat', SXGEO_BATCH | SXGEO_MEMORY); //     

4.   c    (SxGeo Country)
$country = $SxGeo->getCountry($ip); //   ISO- 
// $SxGeo->getCountryId($ip);       //   

5.   (SxGeo City, SxGeo City Max)
// $SxGeo->getCity($ip);     //   ,   ,    
// $SxGeo->getCityFull($ip); //     ,   
$city = $SxGeo->get($ip);    //  getCountry  getCity     

6.      -  
unset($SxGeo);

   sxgeo_sample.php (      
    SxGeoCity.dat)