PHPackages                             testingmic/geoip2country - 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/geoip2country

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

testingmic/geoip2country
========================

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

v2.3(1y ago)034PHP

Since Oct 27Pushed 1y ago1 watchersCompare

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

READMEChangelog (7)DependenciesVersions (7)Used By (0)

PHP IpAddressGeoLocation
========================

[](#php-ipaddressgeolocation)

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/geoip2country
```

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

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

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

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

} 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

26

—

LowBetter than 43% of packages

Maintenance39

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity43

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 ~9 days

Total

6

Last Release

520d ago

Major Versions

v1.2\_stable → v2.02024-10-28

### 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 (19 commits)")

### Embed Badge

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

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

###  Alternatives

[caffeinated/flash

Flash Messages for Laravel

4649.5k2](/packages/caffeinated-flash)

PHPackages © 2026

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