I have a field in a database and I need for it to always show as 5 digits. However right now there is only like 1,2,3,4,5 in the database. I need those to show up as 00001, 00002, 00003 and so on. Anybody have a clue?
Is this for display only?
If it is upon displaying the data:
But this is for display only do not store the zeros in the database.PHP Code:
print str_pad(2, 5, '0', STR_PAD_LEFT);
Logic without the fatal effects.
All code snippets are licensed under WTFPL.