formato php int a 9 dígitos com zeros anteriores

str_pad($input, 9, "0", STR_PAD_LEFT);
Carnivorous Flamingo