php - How can I print number in 4 digit? -


i want print list of numbers in php.
want print 4 digits of numbers (preceding 0 if necessary), e.g.
0001, 0009, 0076, 0129, 1234

what should do?

printf("%04d", $num); 

Comments

Popular posts from this blog

ruby - When to use an ORM (Sequel, Datamapper, AR, etc.) vs. pure SQL for querying -

php - PHPDoc: @return void necessary? -

c++ - Convert big endian to little endian when reading from a binary file -