Skip to content

Instantly share code, notes, and snippets.

@mathewpeterson
Created April 5, 2012 16:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mathewpeterson/2312197 to your computer and use it in GitHub Desktop.
Save mathewpeterson/2312197 to your computer and use it in GitHub Desktop.
This will generate an array of ip address
<?php
function ip_range($from, $to) {
$start = ip2long($from);
$end = ip2long($to);
$range = range($start, $end);
return array_map('long2ip', $range);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment