I have a subroutine/function in Perl like this:
sub numToStr {
my ($ipnum) = @_;
my $z = $ipnum % 256;
$ipnum >>= 8;
my $y = $ipnum % 256;
$ipnum >>= 8;
my $x = $ipnum % 256;
$ipnum >>= 8;
my $w = $ipnum % 256;
return "$w.$x.$y.$z";
}
any ideas how to make it into PHP alternative ?
many thanks,
cheers
Alternatively, you could use the
long2ip()function.