php zero-padding numbers %03d code example
Example 1: prepend 0 to number php
str_pad($month, 2, '0', STR_PAD_LEFT);
Example 2: php format int to 9 digits with preceding zeroes
str_pad($input, 9, "0", STR_PAD_LEFT);
str_pad($month, 2, '0', STR_PAD_LEFT);
str_pad($input, 9, "0", STR_PAD_LEFT);