$numero = "000001";
printf("%07d", $numero);
echo $numero;


mi restituisce:
0000001000001