Thank you very much, all you has confirmed my opinion about my DBA and helped with useful informations.
Thanks for thr info on function ip2long, I didn't know it...
and in the meanwhile to make my web users and my dba happy I wrote a few lignes of code :
function present_ipaddr($abbbcccddd, $n_netbits=32) {
$aaabbbcccddd = sprintf("%012s", $abbbcccddd);
sscanf(substr($aaabbbcccddd,0,3),'%d',$d1);
sscanf(substr($aaabbbcccddd,3,3),'%d',$d2);
sscanf(substr($aaabbbcccddd,6,3),'%d',$d3);
sscanf(substr($aaabbbcccddd,9,3),'%d',$d4);
$p = sprintf('%d.%d.%d.%d', $d1, $d2, $d3, $d4);
if ($n_netbits<32) $p .= '/' . $n_netbits;
return $p;
}
function encode_ipaddr($text) {
if (!$text) return false;
if (4!=sscanf($text, '%d.%d.%d.%d', $d1, $d2, $d3, $d4)) {
return 0;
}
return sprintf('%03d%03d%03d%03d', $d1, $d2, $d3, $d4);
}
But like you say, he is a pain in the neck, yes.