Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Incrementing alphabetic character

Posted on 2007-04-01
3
Medium Priority
?
2,746 Views
Last Modified: 2013-12-12
I know how to increment number in a php script just need a loop and one on every iteration of the loop but is there a way to increment alphabetic letter the same way starting with A and next B and C and so on?
0
Comment
Question by:gamebits
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 27

Accepted Solution

by:
Cornelia Yoder earned 1000 total points
ID: 18833914
Set up an array

$letters=array('a', 'b', 'c', 'd');  // etc

for ($i=1; $i<26; $i++)
{
  $index = $letters[$i];
  then use $index as your letter....
}
0
 
LVL 36

Assisted Solution

by:Zyloch
Zyloch earned 600 total points
ID: 18833923
I think you can just use the increment operator. For instance:

$letter = 'a';
$letter++;
echo($letter);
0
 
LVL 4

Assisted Solution

by:secondv
secondv earned 400 total points
ID: 18833930
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
There are times when I have encountered the need to decompress a response from a PHP request. This is how it's done, but you must have control of the request and you can set the Accept-Encoding header.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to count occurrences of each item in an array.

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question