2017 © Pedro Peláez
 

library inet

A PHP implementation of decimal IPs. Converts IPs from presentation to decimal and viceversa. Very useful to store IPs in database as numbers instead of string, in example in a decimal(39,0) column.

image

foolz/inet

A PHP implementation of decimal IPs. Converts IPs from presentation to decimal and viceversa. Very useful to store IPs in database as numbers instead of string, in example in a decimal(39,0) column.

  • Monday, March 30, 2015
  • by woxxy
  • Repository
  • 5 Watchers
  • 6 Stars
  • 1,714 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 3 Forks
  • 1 Open issues
  • 6 Versions
  • 1 % Grown

The README.md

Foolz\Inet

This Composer package provides two functions that allow converting between IP Address and IP Decimal. It works for both IPv4 and IPv6., (*1)

Based on the answer to "How to convert IPv6 from binary for storage in MySQL?" on StackOverflow by Sander Marechal. Content posted on StackOverflow is under the CC BY-SA 3.0 License., (*2)

Requirements

Usage

$decimal_ip = \Foolz\Inet\Inet::ptod($ip);
$ip = \Foolz\Inet\Inet::dtop($decimal_ip);

Storage on MySQL Databases

You should use a DECIMAL(39,0) column to store the entire IP Decimal., (*3)

The Versions

30/03 2015

dev-master

9999999-dev http://www.foolz.us

A PHP implementation of decimal IPs. Converts IPs from presentation to decimal and viceversa. Very useful to store IPs in database as numbers instead of string, in example in a decimal(39,0) column.

  Sources   Download

CC-BY-SA-3.0

The Requires

  • php >=5.3.0
  • ext-bcmath *

 

by Foolz

ip conversion ipv6 ipv4 presentation decimal

30/03 2015

0.6.0

0.6.0.0 http://www.foolz.us

A PHP implementation of decimal IPs. Converts IPs from presentation to decimal and viceversa. Very useful to store IPs in database as numbers instead of string, in example in a decimal(39,0) column.

  Sources   Download

CC-BY-SA-3.0

The Requires

  • php >=5.3.0
  • ext-bcmath *

 

by Foolz

ip conversion ipv6 ipv4 presentation decimal

26/09 2012

0.5.3

0.5.3.0 http://www.foolz.us

A PHP implementation of decimal IPs. Converts IPs from presentation to decimal and viceversa. Very useful to store IPs in database as numbers instead of string, in example in a decimal(39,0) column.

  Sources   Download

CC-BY-SA-3.0

The Requires

  • php >=5.3.0

 

by Foolz

ip conversion ipv6 ipv4 presentation decimal

15/09 2012

0.5.2

0.5.2.0 http://www.foolz.us

A PHP implementation of decimal IPs. Converts IPs from presentation to decimal and viceversa. Very useful to store IPs in database as numbers instead of string, in example in a decimal(39,0) column.

  Sources   Download

CC-BY-SA-3.0

The Requires

  • php >=5.3.0

 

by Foolz

ip conversion ipv6 ipv4 presentation decimal

15/09 2012

0.5.1

0.5.1.0 http://www.foolz.us

A PHP implementation of decimal IPs. Converts IPs from presentation to decimal and viceversa. Very useful to store IPs in database as numbers instead of string, in example in a decimal(39,0) column.

  Sources   Download

Apache-2.0

The Requires

  • php >=5.3.0

 

by Foolz

ip conversion ipv6 ipv4 presentation decimal

15/09 2012

0.5.0

0.5.0.0 http://www.foolz.us

A PHP implementation of decimal IPs. Converts IPs from presentation to decimal and viceversa. Very useful to store IPs in database as numbers instead of string, in example in a decimal(39,0) column.

  Sources   Download

Apache-2.0

The Requires

  • php >=5.3.0

 

by Foolz

ip conversion ipv6 ipv4 presentation decimal