Page 1 of 1

php letter count

Posted: Tue Dec 16, 2008 6:54 am
by php_chik
Hi there...I am looking for a way to count using letters and numbers together in php but using letters instead....I am looking for a function that can do this for me...

For example a number would count like this: X, Y, Z, 10,11,12 and so on....Basically I want something that can generate numbers like this 3X7ac2...I need the numbers to be generated in order because I have been doing it manually with my hands on my computer to give clients a code..The numbers must all come in order not randomly generated numbers. E.g a customer can have a number like 2v7sN7 and the next number I generate should be 2v7sN8.

I have been doing it manualy but I want to have my website do it in PHP without me doing this. I am tired of doing them all myself. Please help.

Please any assistance would be appreciated

thank you

Re: php letter count

Posted: Tue Dec 16, 2008 12:04 pm
by anjanesh
If case-sensitivity is not required, you could use base_convert.

Code: Select all

$h = '2v7sN7';
echo base_convert(base_convert($h, 36, 10) + 1, 10, 36);
will output 2v7sn8