in reply to increment # but keep # of digits same


Thanks everyone for your replies. I ended up using sprintf because using $a++ wasn't working in my if conditional (to check if the number was less than 9999). For some reason when I had $a++ within the if, it was losing the 4 digits and coming back as just 2, vs. 0002. Outside of the if it was fine. sprintf seems to be working OK with the if however. Thanks again, I appreciate everyone's help.

Incidentally, if the number is >=9999, I just reset the build number back to 0. I honestly don't think the build number will ever get that high, but I put the check in there just in case.
  • Comment on Re: increment # but keep # of digits same