I want to print series like A,B,C ......AB
or T,U,V,.....AB
or BA,BB,BC,.....CA

in series i will input start and end characters
can anybody give me logic
Thanks

Member Avatar for diafol

Strangely, I was working on an alphabetic base convertor recently.

What have you tried? - show your code

<?
$char='T';
$lastchar="AR";
$last=++$lastchar;
for($l=$char;$l!=$last;$l++){
    echo $l;
}
?>

I have done.
Thanks

Member Avatar for diafol

Yep, I think that's as good as it can get :)

I'm assuming though that you allow A and AA and AAA as distinct entities. If you were using base26 (purely alphabetical and not alphanumeric), they would all be equivalent (i.e. = 0).

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.