PHP code example of soltivo / location

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

    

soltivo / location example snippets


$options = [
   "ip" => "127.0.0.1",
   "lang" => "en",
   "fields" => [
       "isp", "org", "as",
    ]
];

$location = new \Soltivo\Location\Location($options);

$countryaa2 = $location->countryCode;
$state = $location->stateName;
$city = $location->city;

$options = [
   "ip" => "",
   "fields" => [],
   "lang" => "",
   "test" => false
];

$testing = false;
$lang = "en";
$fields = [
            "country",
            "countryCode",
            "region",
            "regionName",
            "city",
            "zip",
            "proxy",
            "currency",
            "timezone",
            "continent",
            "continentCode",
            "district"
];