Quote:
Originally Posted by MarcoH64
Don't think too much
It would already do that, i a review with the ip you now provided i found out that the sprintf is really neccesary to avoid negative numbers.
PHP Code:
<?php
$ip = "217.165.90.184";
echo "<br />ip: $ip";
$reversed = implode(".",array_reverse(explode(".", $ip)));
echo "<br />reversed: $reversed";
$reversedlong = sprintf("%u",ip2long(implode(".",array_reverse(explode(".", $ip)))));
echo "<br />reversedlong: $reversedlong";
?>
Will produce:
Code:
ip: 217.165.90.184
reversed: 184.90.165.217
reversedlong: 3092948441
|
Excellent MarcoH64 .. that did help! You are right about sprintf, thanks a million!
Paul M - Just have to, thats how things work sometimes
BTW, thanks for the help guys, i got what i wanted
Really appreciate everyones help here, especially MarcoH64.