Reputation: 15706
I want to print a list of numbers in php.
But I want to print 4 digits of numbers (preceding with zero if necessary), e.g.
0001, 0009, 0076, 0129, 1234
What should I do?
Upvotes: 2
Views: 2715
Reputation: 15118
Look at the PHP Language Reference Manual and search for zero-padded integers
The link gives the sprintf
details, but the format string information applies to related functions like printf
Upvotes: 0