Solved

Incrementing alphabetic character

Posted on 2007-04-01
3
2,737 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 250 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 150 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 100 total points
ID: 18833930
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

717 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