function ipVer ( $ipWithSubnet )
{
	list($ip, $subnetMask) = explode('/', $ipWithSubnet);

	$ipLong = ip2long($ip);
	$subnetMaskLong = -1 << (32 - $subnetMask);
	$networkAddress = $ipLong & $subnetMaskLong;
	$broadcastAddress = $networkAddress | ~$subnetMaskLong;

	$availableIPs = array();
	for ($i = $networkAddress + 1; $i < $broadcastAddress; $i++) 
	{
		$availableIPs[] = long2ip($i);
	}

	return $availableIPs;
}

$ipWithSubnet = "212.68.54.128/28";
print_r ( ipVer ( $ipWithSubnet ) );
Categories: PHP language

2 Comments

Sildenafil Absorption Concepts · 19/09/2026 at 22:11

Sildenafil Absorption Concepts

Sildenafil Absorption Concepts

Sildenafil Fed-State Overview · 20/09/2026 at 07:50

Sildenafil Fed-State Overview

Sildenafil Fed-State Overview

Leave a Reply

Avatar placeholder