Solved

Incrementing alphabetic character

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
php mail headers 2 14
Cross domain request in Javescript 9 29
Change password through link 1 13
PHP JSON Clean up 5 10
This article discusses four methods for overlaying images in a container on a web page
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

746 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now