PHP code example of wakumaku / ip2c

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

    

wakumaku / ip2c example snippets




$ip2c = \Ip2c\Ip2cFactory::build();

$result = $ip2c->self();

echo "Status: " . $result->status() . "\n";
echo "Iso2: " . $result->iso2() . "\n";
echo "Iso3: " . $result->iso3() . "\n";
echo "Name: " . $result->name() . "\n";