Posted by bobzimuta on 10/11/58 11:39
why not combine the two ip functions ip2long and long2ip:
from http://us2.php.net/manual/en/function.ip2long.php
<?php
// make sure IPs are valid. also converts a non-complete IP into
// a proper dotted quad as explained below.
$ip = long2ip(ip2long("127.0.0.1")); // "127.0.0.1"
$ip = long2ip(ip2long("10.0.0")); // "10.0.0.0"
$ip = long2ip(ip2long("10.0.256")); // "10.0.1.0"
?>
Navigation:
[Reply to this message]
|