Suppose the input is:
222.123.34.45 and 222.123.34.55
then I need to output the ip address in between them:
222.123.34.45 222.123.34.46 ... 222.123.34.55
Suppose the input is:
222.123.34.45 and 222.123.34.55
then I need to output the ip address in between them:
222.123.34.45 222.123.34.46 ... 222.123.34.55
function ip_range($from, $to) {
$start = ip2long($from);
$end = ip2long($to);
$range = range($start, $end);
return array_map('long2ip', $range);
}
The above turns the two IP addresses into numbers (using PHP core functions), creates a range of numbers and then turns that number range into IP addresses.
If you want them separated by spaces just implode() the result.