You can convert the character into its ASCII value using ord(), increment/decrement that value then convert it back to a character using chr():
$a = 'a';
$num = 2;
$a = chr(ord($a)+$num);
echo $a;
// outputs c
ord- Return ASCII value of character
chr- Return a specific character
If you want the increment/decrement to wrap around a value that exceeds z
then you can use this:
$a = 'a';
$num = 28;
echo chr((26 + (ord($a)+$num-97)) % 26 + 97);
// outputs c
Note: As php modulus of a negative number returns a negative number this will not work or $num
values < -26 alternative solution include using gmp_mod
as mentioned here.
Hope this helps!