I'm working on a calendar site and need to change the following code to show 0
before the value of $list_day
if it's a single digit number.
for($list_day = 1; $list_day <= $days_in_month; $list_day++):
How should I go about doing this?
When you're printing it, use sprintf("%02d", $list_day)
to pad it with a zero.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With