Forum Moderators: coopster
Is this perl or PHP?
You might want to convert the character into its ASCII code, increment that, possibly subtract 26 or 52 or 62, and convert back to a character. I'm not sure what you'll do about strings that are more than one character, or are not ASCII characters (do you want UTF-8 or anything?).
Hope it helps you think a little more about what you are actually looking for.
My suggestion, put all the letters in an array. THEN refer to the array with a number. In the case below 0 = a, 1 = b, etc...
EXAMPLE:
#!/usr/bin/perl#define your arrary of letters
@letters = ("a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z");
#This will just print all the letters
while ($counter <= 25) {
print "$letters[$counter]\n";
$counter++;
}
That help?
and i want to make a script that makes a variable that have a value of a to gett every letter to z like i can gett 1 and evre nubers to 20 for example for the numbrers i do like this
$a = 1;
do {
echo "here is $a";
echo "<br>;
$a = $a++;
=while($a<=20);
how does i do so a letter can be from a to z?