proipinfo/php-client

PHP module provides client for proip.info binary databases

1.1.1 2021-09-06 10:06 UTC

This package is auto-updated.

Last update: 2025-06-24 14:05:11 UTC


README

Requirements

  • PHP 5.6 or newer
  • bcmath extension

Installation

composer require proipinfo/php-client

Usage

<?php

require dirname(__FILE__) . '/vendor/autoload.php';

$db = new ProIPInfo\DbStream('/path/to/db', true);
$client = new ProIPInfo\Client($db);

$rec = $client->getRecord('8.8.8.8');
if (empty($rec)) {
    throw(new \Exception('Not found'));
}

echo $rec->countryCode;
echo $rec->region;
echo $rec->city;
echo $rec->ISP;

More information docs on ProIP.info