php add leading 0 code example
Example 1: prepend 0 to number php
str_pad($month, 2, '0', STR_PAD_LEFT);
Example 2: format a number with leading zeros in php
sprintf('%06d', '12')
str_pad($month, 2, '0', STR_PAD_LEFT);
sprintf('%06d', '12')