I have a string with a one or two digit number and I want to fill it with zeros. Can someone remind me how I do it.
Example:
12 -> 0012, 3 -> 0003
Thanks in advance,
Aetoc
fill string with a character.
Moderator: General Moderators
-
WebbieDave
- Forum Contributor
- Posts: 213
- Joined: Sun Jul 15, 2007 7:07 am
Re: fill string with a character.
Code: Select all
str_pad($num, 4, '0', STR_PAD_LEFT);Re: fill string with a character.
Thanks. You save me
