?
Solved

Incrementing alphabetic character

Posted on 2007-04-01
3
Medium Priority
?
2,742 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying 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

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.
In this blog, we’ll look at how improvements to Percona XtraDB Cluster improved IST performance.
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 look for a specific file type in a local or remote server directory using PHP.
Suggested Courses

765 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