Jump to content

Keep Zero In Front of Digit?


chaseman

Recommended Posts

This for loop:

 

for ($m = 01; $m <= 12; $m++)

 

Will output:

1

2

3

4

etc.

 

And NOT:

01

02

03

04

 

 

My question is: how can I make the number be 2 digits and have it output together with the ZERO?

 

And when it's reaching the number 10 it should continue outputting:

 

10

11

12

 

And not

 

010

011

etc.

Link to comment
https://forums.phpfreaks.com/topic/228945-keep-zero-in-front-of-digit/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.