Can Some body will help me how can I genrete 5 digit code like if I have a code Like
00001
00002
.
.
.
00009
and then after this it should come back like below
00019
.
.
99999
Please can somebody help me which type of loop I have to do to increment forward and decrements backward.
Many thanks
Using
str_pad()to produce a string of constant length, padded by zeros on the left :And, to go backwards, just change the starting value, condition, and use a decrement in your for loop :