Re: [PHP] Numbers with leading zero...

2002-07-24 Thread Tom Rogers
Hi, Thursday, July 25, 2002, 10:44:00 AM, you wrote: v> Hi. v> I've got this script that needs to take for examle 02 and increase that to v> 03. v> but when i run the script $Num++; it changes 03 to 3; v> is there not a function that adds leading zeros onto a string ? have a look at the spr

RE: [PHP] Numbers with leading zero...

2002-07-24 Thread Martin Towell
you could use: printf("%02d", ++$Num); or if you want to put it back into $Num, use the sprintf() version -Original Message- From: vins [mailto:[EMAIL PROTECTED]] Sent: Thursday, July 25, 2002 10:44 AM To: [EMAIL PROTECTED] Subject: [PHP] Numbers with leading zero... Hi. I've got this