add leading zeros in php code example Example: prepend 0 to number php str_pad($month, 2, '0', STR_PAD_LEFT);