Q:

Increment letters by 2

I would like to increment a letter by 2. This way, A will become C, Z will become AB.
It works well when I increment by 1 with $letter++ but I can't find a way to do it.
Thanks for any help

A:

You could use a function like this one to increment variable as many time as wished :
function increment($val, $increment = 2)
{
    for ($i = 1; $i <= $increment; $i++) {
        $val++;
    }

    return $val;
}

Usage :
$var = increment('a', 2);
var_dump($var);

