PHPackages                             worm/getclientiplib - 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. worm/getclientiplib

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

worm/getclientiplib
===================

GetClientIp is a lightweight PHP class for get real/original client IP address, without proxy as opera mini and other.

1.0.8(7y ago)1814.1k—3%111MITPHPPHP &gt;=5.2.0

Since Feb 23Pushed 4y ago2 watchersCompare

[ Source](https://github.com/Worm/GetClientIp)[ Packagist](https://packagist.org/packages/worm/getclientiplib)[ Docs](https://github.com/worm/GetClientIp)[ RSS](/packages/worm-getclientiplib/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (1)Dependencies (3)Versions (11)Used By (1)

*GetClientIp is a lightweight PHP class for get real/original client IP address, without proxy as opera mini and other. It uses the specific $\_SERVER headers to detect client ip address. Class search valid IPv4 of client.*

Composer install
----------------

[](#composer-install)

```
composer require worm/getclientiplib

```

```
{
    "require": {
        "worm/getclientiplib": "^1.0"
    }
}
```

Usage
-----

[](#usage)

```
$getClientIp = new GetClientIp;
$ip = $getClientIp->getClientIp();
$longIp = $getClientIp->getLongClientIp();
```

Usage with manual data
----------------------

[](#usage-with-manual-data)

```
$getClientIp = new GetClientIp(array( "REMOTE_ADDR"           => "1.2.3.4",
                                      "REMOTE_PORT"           => "",
                                      "SERVER_ADDR"           => "1.1.1.1",
                                      "X_FORWARDED_FOR"       => "2.3.4.5,1.2.3.4, 1.2.3.4" ));
$ip = $getClientIp->getClientIp();
$longIp = $getClientIp->getLongClientIp();
```

###  Health Score

37

—

LowBetter than 81% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity37

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity64

Established project with proven stability

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

Recently: every ~195 days

Total

9

Last Release

2696d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4e73d9e65ee8006883ba449def891276154da25c0687ebde1d639b6b79184657?d=identicon)[Worm](/maintainers/Worm)

---

Top Contributors

[![Worm](https://avatars.githubusercontent.com/u/11246757?v=4)](https://github.com/Worm "Worm (24 commits)")

---

Tags

IPip-addressip detectip detectorphp ip detectdetect ip client

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/worm-getclientiplib/health.svg)

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

###  Alternatives

[stevebauman/location

Retrieve a user's location by their IP Address

1.3k8.9M97](/packages/stevebauman-location)[zoujingli/ip2region

PHP IP 地理位置查询库，基于 ip2region XDB，支持 IPv4/IPv6、内置 IPv4 数据库、IPv6 按需下载和多种缓存策略

1.4k491.4k71](/packages/zoujingli-ip2region)[mlocati/ip-lib

Handle IPv4, IPv6 addresses and ranges

3167.6M84](/packages/mlocati-ip-lib)[s1lentium/iptools

PHP Library for manipulating network addresses (IPv4 and IPv6)

2446.8M30](/packages/s1lentium-iptools)[vectorface/whip

A PHP class for retrieving accurate IP address information for the client.

3721.2M14](/packages/vectorface-whip)[markrogoyski/ipv4-subnet-calculator

Network calculator for subnet mask and other classless (CIDR) network information.

178865.2k15](/packages/markrogoyski-ipv4-subnet-calculator)

PHPackages © 2026

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