PHP code example of foxliscom / geo

1. Go to this page and download the library: Download foxliscom/geo 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/ */

    

foxliscom / geo example snippets


use Foxliscom\Geo\FoxlisGeo;

// Get City
echo FoxlisGeo::location()->getCity();

// Get Country
echo FoxlisGeo::location()->getCountry();

// Get Continent
echo FoxlisGeo::location()->getContinent();

// Get Subdivisions List
$subdivisions = FoxlisGeo::location()->getSubdivisions();

// Get Location Data
$locationData = FoxlisGeo::location()->getLocation();

// Get Accuracy Radius
echo $locationData->getAccuracyRadius();

// Get Latitude
echo $locationData->getLatitude();

// Get Longitude
echo $locationData->getLongitude();

// Get Time Zone
echo $locationData->getTimeZone();

// Get Account Info
FoxlisGeo::account()->getData();

// Russian
echo FoxlisGeo::location()->getCity()->ru;

// Spanish
echo FoxlisGeo::location()->getCity()->es;

// English
echo FoxlisGeo::location()->getCity()->en;

// German
echo FoxlisGeo::location()->getCity()->de;

// French
echo FoxlisGeo::location()->getCity()->fr;

// Japanese
echo FoxlisGeo::location()->getCity()->ja;

// Portuguese
echo FoxlisGeo::location()->getCity()->ptBR;

// Chinese
echo FoxlisGeo::location()->getCity()->zhCN;

function getFoxlisGeoConfig()
{
    return [
        // Your params here
    ];
}