PHPackages                             testingmic/ipaddress - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. testingmic/ipaddress

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

testingmic/ipaddress
====================

Get the current visitor IP Address and determine the country, city, latitude, longitude, and ISP

v1.3(1y ago)02.9k↓47.6%PHP

Since Dec 15Pushed 1y ago1 watchersCompare

[ Source](https://github.com/testingmic/ipaddress)[ Packagist](https://packagist.org/packages/testingmic/ipaddress)[ RSS](/packages/testingmic-ipaddress/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)DependenciesVersions (4)Used By (0)

PHP IpAddress
=============

[](#php-ipaddress)

An IP address helps you identify visitors geographical location.

A PHP IP Address Geolocation library to help you identify visitors geographical location.

Requirements
------------

[](#requirements)

- pdo\_sqlite (runtime deps)
- php\_curl (for update only)

Installation And Initialisation :
---------------------------------

[](#installation-and-initialisation-)

These instructions will get you a copy of the project up and running on your local machine. there are two options:

- Using Composer installer(Recommended) by typing the following command:

```
composer require testingmic/ipaddress
```

Usage: (using Composer autoloader)
----------------------------------

[](#usage-using-composer-autoloader)

```
require __DIR__ . '/vendor/autoload.php';

try
{
    $IpAddressGeo = new testingmic\IpAddress();

} catch (\Throwable $th) {
    trigger_error($th->getMessage(), E_USER_ERROR);
}
```

#### Getting Country code from given IP address:

[](#getting-country-code-from-given-ip-address)

```
    $ipAddress_1='37.140.250.97';

    echo '';
    print_r($IpAddressGeo->resolve($ipAddress_1));

    Array
    (
        [start] => 629996032
        [end] => 629996288
        [country_code] => UA
        [country_name] => United States
        [continent_code] => NA
        [city] => Alexandria
        [latitude] => 38.8031
        [longitude] => -77.0388
    )
```

#### Getting current visitor Country code (auto detect his IP address):

[](#getting-current-visitor-country-code-auto-detect-his-ip-address)

```
    echo '';
    print_r($IpAddressGeo->resolve());  /** resolve() method called without any argument */
```

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance40

Moderate activity, may be stable

Popularity21

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity40

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

3

Last Release

519d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/194b4107062b9f769c01f7fa567a1fc2dd34e44985bcd05867ee0b4fa80d962e?d=identicon)[testingmic](/maintainers/testingmic)

---

Top Contributors

[![testingmic](https://avatars.githubusercontent.com/u/42424404?v=4)](https://github.com/testingmic "testingmic (6 commits)")

### Embed Badge

![Health badge](/badges/testingmic-ipaddress/health.svg)

```
[![Health](https://phpackages.com/badges/testingmic-ipaddress/health.svg)](https://phpackages.com/packages/testingmic-ipaddress)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
