PHP Classes


Recommend this page to a friend!
  Classes of Josantonius  >  PHP-Ip  >  >  Download  
Role: Documentation
Content type: text/markdown
Description: Documentation
Class: PHP-Ip
Get the real user IP address even behind proxies
Author: By
Last change: Updated to 1.1.4 version
Date: 13 days ago
Size: 3,178 bytes


Class file image Download

PHP Ip library

Latest Stable Version Total Downloads Latest Unstable Version License Travis

Versión en español

PHP class to get user IP.


The preferred way to install this extension is through composer.

To install PHP Ip library, simply:

$ composer require Josantonius/Ip

The previous command will only install the necessary files, if you prefer to download the entire source code (including tests, vendor folder, exceptions not used, docs...) you can use:

$ composer require Josantonius/Ip --prefer-source

Or you can also clone the complete repository with Git:

$ git clone


This library is supported by PHP versions 5.6 or higher and is compatible with HHVM versions 3.0 or higher.

Quick Start and Examples

To use this class, simply:

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

use Josantonius\Ip\Ip;

Available Methods

Available methods in this library:



Example of use for this library:

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

use Josantonius\Ip\Ip;

print_r(Ip::get()); #


To run tests simply:

$ git clone

$ cd PHP-Ip

$ phpunit


  • [x] Create tests
  • [ ] Improve documentation


  1. Check for open issues or open a new issue to start a discussion around a bug or feature.
  2. Fork the repository on GitHub to start making your changes.
  3. Write one or more tests for the new feature or that expose the bug.
  4. Make code changes to implement the feature or fix the bug.
  5. Send a pull request to get your changes merged and published.

This is intended for large and long-lived objects.


All files in this repository were created and uploaded automatically with Reposgit Creator.


This project is licensed under MIT license. See the LICENSE file for more info.


2017 Josantonius,

If you find it useful, let me know :wink:

You can contact me on Twitter or through my email.