codehaven - php snippets - coding help
Generic filters
Exact matches only

Add a leading zero to numbers – Sprintf

18th February 2019

Php - Maths

php codehaven

Problem: I have some code that displays
but I need

Answer below: –
(the %02d shows 1 zero before, change this to %02d and it will be 001)

Output 01

Was this code snippet helpful?