### Get City Information Source: https://sypexgeo.net/en/docs Retrieve city information for a given IP address. getCity returns brief details, while getCityFull provides complete information including region and timezone. The get method automatically determines whether to perform a country or city lookup based on the database type. ```php $city = $SxGeo->get($ip); // performs getCountry or getCity depending on the database type ``` -------------------------------- ### Get Country Information Source: https://sypexgeo.net/en/docs Retrieve the two-digit ISO country code for a given IP address using the getCountry method. ```php $country = $SxGeo->getCountry($ip); // returns the two-digit ISO country code ``` -------------------------------- ### Create SxGeo Object Source: https://sypexgeo.net/en/docs Instantiate the SxGeo class. The default mode uses a database file. Alternative modes like SXGEO_BATCH and SXGEO_MEMORY can be combined for faster processing at the cost of more memory. ```php $SxGeo = new SxGeo(); // Default mode, database file SxGeo.dat ``` ```php $SxGeo = new SxGeo('SxGeo.dat', SXGEO_BATCH | SXGEO_MEMORY) ; // The fastest mode is batch mode ``` -------------------------------- ### Include SxGeo.php Source: https://sypexgeo.net/en/docs Include the main Sypex Geo library file in your PHP script. ```php include("SxGeo.php"); ``` -------------------------------- ### Free Up Resources Source: https://sypexgeo.net/en/docs Delete the SxGeo object to free up memory and resources when it is no longer needed. ```php unset($SxGeo); ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.