php integer format leading zero code example Example: php format int to 9 digits with preceding zeroes str_pad($input, 9, "0", STR_PAD_LEFT);