[PHP] for loop changes?

2001-09-14 Thread Michael Gerholdt

In PHP Version 4.0.3pl1

for ($i='01';$i=12;$i++)

the increment used to produce

01
02
03
...
09
10
11
12

but in

PHP Version 4.0.6

the identical script

for ($i='01';$i=12;$i++)

produces:

01
2
3
...
9
10
11
12

I want the week and month days to have leading zeros - how can I make the
new environment replicate the old?

thanks
Mike


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] for loop changes?

2001-09-14 Thread Mark Charette

From: Michael Gerholdt [EMAIL PROTECTED]

 I want the week and month days to have leading zeros - how can I make the
 new environment replicate the old?

Loop using the numeric but use printf for the formatting (which is really
what you should have used originally). Refer to the manual for the many and
varied ways printf can be used.

Mark C.




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]