php letter count

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
php_chik
Forum Newbie
Posts: 3
Joined: Tue Dec 16, 2008 6:42 am

php letter count

Post 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
User avatar
anjanesh
DevNet Resident
Posts: 1679
Joined: Sat Dec 06, 2003 9:52 pm
Location: Mumbai, India

Re: php letter count

Post 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
Post Reply