I took the liberty to write out a script to perform the task stated by the OP... I don't have time to fin it atm but you can take a look and get an idea of how i'm doing it, possibly help you.. I'll try to finish it after my next class.
<?php
/////////////////////////////////////////
///^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^///
///^^ Calculate Ip Range difference ^^///
///^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^///
/////////////////////////////////////////
//Example (192.168.11.10) - (192.168.10.1) = 268 Addresses
////////////////////////////////
//### START AND END IP #s ###///
////////////////////////////////
$Start = explode('.','192.168.10.1');
$End = explode('.','192.168.11.10);
$Part =;
////////////////////////////////////////////////////
//### Initiate Place holder for generated IP's ###//
////////////////////////////////////////////////////
$GendIP = Array();
///////////////////////////////
//### Min/Max IP # Ranges ###//
///////////////////////////////
$Max = 255;
$Min = 0;
$Cap = Array();
$NumIP = 0;
//////////////////////////
//### How Many IP's? ###//
//////////////////////////
for($i=0; $i<4; $i++)
{
//First check if the IP segments match
//as then there is not calc to be done
if($Start[$i] == $End[$i])
{
//The first segment of the two IP's given match
//So there is nothing to be done.
//Set cap place holder
$Cap[$i] = nil;
}
else
{
//The IP segments don't match so we will find a //range cap for this segment
$Cap[$i] = $End[$i] - $Start[$i];
}
if($Cap[$i] != 'nil')
{
$NumIP += $Cap[$i]
}
}
//Gen the Ip's
for($i=0; $i<=$NumIP; $i++)
{
}
?>