Solved

Incrementing alphabetic character

Posted on 2007-04-01
3
2,733 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:
yodercm 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

These days socially coordinated efforts have turned into a critical requirement for enterprises.
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
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 dynamically set the form action using jQuery.

733 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