I would like to print an IP in fixed way.. example
12.12.1.0
would tured to
012.012.001.000
what's the best method do it ?
printf("%.4f.%.4f.%.4f.%.4f",$ip);
?
I would like to print an IP in fixed way.. example
12.12.1.0
would tured to
012.012.001.000
what's the best method do it ?
printf("%.4f.%.4f.%.4f.%.4f",$ip);
?
With zero padding:
$ip = "12.12.1.0";
vprintf("%03d.%03d.%03d.%03d", explode('.', $ip));