A while ago I needed to automatically zero fill a number for a quoting system I was working on. I decided to browse the internet to search for a simple code snippit but I could only find code with a while loop that would keep adding zeroes untill the desired string length was reached. Although this seemed okay, I realized it could be done much cleaner, and most important, less draining for system resources. So I wrote the following function. Continue reading “How to zero fill a number in PHP”