2017 © Pedro Peláez
 

library php-ip-helper

PHP IP Helper

image

kfosoft/php-ip-helper

PHP IP Helper

  • Wednesday, October 7, 2015
  • by KFOSOFT
  • Repository
  • 1 Watchers
  • 0 Stars
  • 245 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

PHP IP Helper

Installation

Installation with Composer, (*1)

Either run, (*2)

    php composer.phar require kfosoft/php-ip-helper:"*"

or add in composer.json, (*3)

    "require": {
        ...
        "kfosoft/php-ip-helper":"*"
    }

Well done!, (*4)

API

localIpsV4 - Return local ips. Use ifconfig.
localIpV4  - Return local ip. Use ifconfig.
validate   - Validate ip.
validateV4 - Validate ipv4.
validateV6 - Validate ipv6.
ipv4ToLong - Ip v4 to long.
longToIpv4 - Long to ipv4.
ipv6ToLong - Ip v6 to long.
longToIpv6 - Long to Ip v6.
ip2bin     - Ip to bin.
bin2ip     - Bin to ip.
version    - Returns ip version.

Example

use kfosoft\helpers\IP;

var_dump(IP::localIpsV4());
Result
array(2) {
  ["eth0"]=>
  string(13) "192.168.0.105"
  ["lo"]=>
  string(9) "127.0.0.1"
}

Enjoy, guys!, (*5)

The Versions

07/10 2015

dev-master

9999999-dev

PHP IP Helper

  Sources   Download

The Requires

  • php >=5.4.0
  • ext-gmp *

 

by Cyril Turkevich

php php helper php ip ip helper php ip helper

07/10 2015

1.0

1.0.0.0

PHP IP Helper

  Sources   Download

The Requires

  • php >=5.4.0
  • ext-gmp *

 

by Cyril Turkevich

php php helper php ip ip helper php ip helper