Here's simple example using the printf function to output a number with leading zeros.
printf
<? $number = 15; printf("%05d", $number); ?>
It seems that irt doesn't work all the time: example$y=decbin(3327);echo $y."<br>";$z = sprintf("%012d", $y);echo $z;I get3327110011111111002147483647...