PHP code example of sudiptpa / ipstack

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

    

sudiptpa / ipstack example snippets


    $ipstack = new Sujip\Ipstack\Ipstack($ip);

    $ipstack->country();

    $ipstack->city();

    $ipstack->region();

    $ipstack = new Sujip\Ipstack\Ipstack($ip, $api_key);

    $ipstack->formatted();

    $ipstack = (new Sujip\Ipstack\Ipstack($ip, $api_key))->secure();

    $ipstack->formatted();