PHPackages                             milad-abooali/print-ip - 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. milad-abooali/print-ip

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

milad-abooali/print-ip
======================

Return IPv4 or IPv6 for using in shel scripts, web scripts and even server-side scripts to get th IP.

01PHP

Since Jul 22Pushed 4y agoCompare

[ Source](https://github.com/Milad-Abooali/print-ip)[ Packagist](https://packagist.org/packages/milad-abooali/print-ip)[ RSS](/packages/milad-abooali-print-ip/feed)WikiDiscussions main Synced 2d ago

READMEChangelogDependenciesVersions (1)Used By (0)

print-ip
========

[](#print-ip)

Return IPv4 or IPv6 for using in shell scripts, web scripts and even server-side scripts to get the IP.

Notice: x-Forward not covered.

Installation
------------

[](#installation)

This project available with composer:

```
$ composer require milad-abooali/print-ip

```

Usage
=====

[](#usage)

Online example:

Auto detect main IP version:

```
$  curl -L ip.codebox.ir

```

Selector for IPv6, return null on IPv4:

```
$  curl -L ip.codebox.ir?v=6

```

Selector for IPv4, return null on IPv6:

```
$  curl -L ip.codebox.ir?v=4

```

Call from diffrent interface using curl:

```
$ curl -L --interface eth0 ip.codebox.ir

```

###  Health Score

15

—

LowBetter than 3% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity1

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity29

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/9e2b8a7ad07661e4770406c881c96213a60a0fdc21717d06004abdab18f1ccef?d=identicon)[Milad.Abooali](/maintainers/Milad.Abooali)

---

Top Contributors

[![Milad-Abooali](https://avatars.githubusercontent.com/u/17283628?v=4)](https://github.com/Milad-Abooali "Milad-Abooali (10 commits)")

### Embed Badge

![Health badge](/badges/milad-abooali-print-ip/health.svg)

```
[![Health](https://phpackages.com/badges/milad-abooali-print-ip/health.svg)](https://phpackages.com/packages/milad-abooali-print-ip)
```

###  Alternatives

[cerbero/lazy-json

Framework-agnostic package to load JSONs of any dimension and from any source into Laravel lazy collections.

254309.8k1](/packages/cerbero-lazy-json)[ldaptools/ldaptools

LdapTools is a feature-rich LDAP library for PHP 5.6+.

204263.9k1](/packages/ldaptools-ldaptools)[ezsystems/ezplatform-standard-design

eZ Platform Standard Design Bundle

30705.9k10](/packages/ezsystems-ezplatform-standard-design)[symbiote/silverstripe-grouped-cms-menu

Allows you to group CMS menu items.

3696.2k6](/packages/symbiote-silverstripe-grouped-cms-menu)[phoenix-lib/nova-nested-tree-attach-many

Nova vue-tree-select field for management nested category relations.

3587.4k](/packages/phoenix-lib-nova-nested-tree-attach-many)[sajadsdi/laravel-setting-pro

Easy settings management for laravel framework

1315.9k](/packages/sajadsdi-laravel-setting-pro)

PHPackages © 2026

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