• Notice regarding image hosts and attachments. See here.

PHP function like Perl Net::IP

Associate
Joined
27 Jun 2006
Posts
1,473
Chaps.

I need to write a script that takes a range of IP address, say 195.45.6.7 - 195.45.6.19, and then print them out one by one.

Now in Perl, its simple to do with Net::IP module and the code below:
Code:
my $ip = new Net::IP ('195.45.6.7 - 195.45.6.19') || die;
  # Loop
  do {
      print $ip->ip(), "\n";
  } while (++$ip);

Now how would I go about that in PHP - I am stumped!

Cheers
M.
 
Back
Top Bottom