I have a field with a limit of 4 characters where I will enter a value, I would like the remaining space to be completed with zeros from left to right, for example, if the user enters the number 4. I would have to leave 0004 if I inserted 100 , would have to quit 0100, if 1000 was inserted, would quit 1000, and so on.
How can I do this with PHP?