Page loads - 2454. This page last modified on 01 Nov 2007
.i.p.v.4. .c.a.l.c.u.l.a.t.o.r.
I did this for fun a few years ago, I can not remember the exact reason why, but I find it
to be useful every now and again. This is a class that takes an IP Address as input at creation.
The address supplied may either be in IP ADDRESS / SUBNET MASK or IP ADDRESS / CDIR format.
Several class variables are then set with different information about the passed IP Address.
As I said eariler, I just did this for fun (yes I know, I need serious help!) several
years ago so there is some major room for improvement.
IP Address / Subnet Mask or CIDR
(example 192.168.1.1/255.255.255.224 or 192.168.1.1/30)
Here is the code:
<?php // IPv4 Address Class class CKORP_IPv4 {
var $ip_address; var $binary_ip_address; var $subnet_mask; var $binary_subnet_mask; var $cidr; var $binary_cidr; var $total_hosts; var $network_address; var $broadcast_address;
The trademarks, logos and service marks ("Marks") displayed on this Web site are the property of cKorp or other third parties.
You are not permitted to use these Marks without the prior written consent of cKorp or such third party which may own the Mark.
Use of cKorp trademarks almost always requires written permission or a license.