There’s a string, containing characters [a-zA-Z0-9]. This should be 26 * 2 + 10 = 62 possibilities in one character and 62^2 in two. What is the preferred way to increment a value of such a string, so that ‘aA’, becomes ‘aB’, etc.? Is there any built-in stuff in PHP, that can help?
I know you can increment a string, but that’s only lowercase letters. Essentially, the result should go from ‘a’ to ‘aa’ in 61 increments.
The @simshaun dont work for me. I check the documentation and I found base_convert that can work for you (on base 35) and a comment of “francesco[at]paladinux.net” with a function to work on base65.
so the solution can be:
convert to b10 -> increment +1 -> convert base 65
EDIT 1
talking about convert I think to base64 coding so I wrote this 2 funcs using base64 encode/decode numbers.
Unfortunately the charset used is a bit larger: [a-zA-Z0-9/+=], but using an internal function more efficent.
The Zero
0 is “AA==”