2017 © Pedro Peláez
 

library network-calculator

Tools to calculate network subnet, prefix, mask, IP range in PHP

image

rpodwika/network-calculator

Tools to calculate network subnet, prefix, mask, IP range in PHP

  • Saturday, June 25, 2016
  • by rpodwika
  • Repository
  • 1 Watchers
  • 4 Stars
  • 4 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 0 % Grown

The README.md

Network calculator in PHP

Build Status Coverage Status Dependency Status Latest Stable Version Total Downloads Latest Unstable Version License, (*1)

During searching for good network calculator I couldn't find a good one written in PHP. That's why I've decided to write it using only bitmask operations and math., (*2)

What can I calculate?

  • Network address
  • Broadcast address
  • CIDR prefix
  • First and last IP in the network
  • Number of possible hosts in the network

How to use?

$networkCalculator = new NetworkCalculator("192.168.1.14, "255.255.255.0");

echo $networkCalculator->calculateNetworkAddress(); // 192.168.1.0
echo $networkCalculator->calculateBroadcastIp(); // 192.168.1.255
echo $networkCalculator->calculateNetworkMaskLength(); // 24

list($first, $last) = $networkCalculator->calculateIpRange();

echo $first; // 192.168.1.1
echo $last; // 192.168.1.254

echo $networkCalculator; // will print all the information in pretty way

Found a bug?

Just make pull request or report issue, (*3)

The Versions

25/06 2016

dev-master

9999999-dev

Tools to calculate network subnet, prefix, mask, IP range in PHP

  Sources   Download

MIT

The Development Requires

25/06 2016

dev-develop

dev-develop

Tools to calculate network subnet, prefix, mask, IP range in PHP

  Sources   Download

MIT

The Development Requires

25/06 2016

0.1.1

0.1.1.0

Tools to calculate network subnet, prefix, mask, IP range in PHP

  Sources   Download

MIT

The Development Requires

25/06 2016

0.1.2

0.1.2.0

Tools to calculate network subnet, prefix, mask, IP range in PHP

  Sources   Download

MIT

The Development Requires

25/06 2016

0.1.0

0.1.0.0

Tools to calculate network subnet, prefix, mask, IP range in PHP

  Sources   Download

MIT

The Development Requires