PHP code example of danilo9 / get_ip

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

    

danilo9 / get_ip example snippets


use Danilo9\GetIp\GetIp;
$getIp = new GetIp();

$getIp = new GetIp(['lang' => 'ru']);

$info = $getIp->process('176.59.134.100');

// Returning string
$info->getStatus();
$info->getIp();
$info->getContinent();
$info->getContinentCode();
$info->getCountry();
$info->getCountryCode();
$info->getCurrency();
$info->getRegionName();
$info->getCity();
$info->getTimezone();
$info->getZip();
$info->getRegion();
$info->toJson();
$info->getLocation()->toJson();
$info->getPrivacy()->toJson();
// int
$info->getLocation()->getLat();
$info->getLocation()->getLon();
//bool
$info->getPrivacy()->getMobile();
$info->getPrivacy()->getProxy();
$info->getPrivacy()->getHosting();
// array
$info->toArray();
$info->getLocation()->toArray();
$info->getPrivacy()->toArray();
// jSON
$info->toJson();
$info->getLocation()->toJson();
$info->getPrivacy()->toJson();