I have this odd situation and I can't think of a solution for it.
I have a variable $cat_count = 1;
and I use it inside a loop and then do $cat_count++
somewhere below where I've used it.
Then I have another alphabetical counter which works the following way:
I have $alpha_string = 'abcdefghijklmnopqrstuvwxyz';
and $alpha_counter = 0;
. I use this the following way - $alpha = $alpha_string{$alpha_counter}
. I want my alphabetical counter to start counting from a, whenever $cat_count
gets incremented by one.
So for example we would have this:
$cat_count = 1
$alpha = a
$alpha = b
$cat_count = 2
$alpha = a
$alpha = b
What I get momentarily is this:
$cat_count = 1
$alpha = a
$alpha = b
$cat_count = 2
$alpha = c
$alpha = d
Ideas?
Thank you.