Using an array:
$cla=array('A', 'B', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'R', 'S', 'Š', 'Z', 'Ž', 'T', 'U', 'V', 'Õ', 'Ä', 'Ö', 'Ü'); $direction = -1; $element = 'Ü'; $element2 = $cla[((array_search($element,$cla)+count($cla)+$direction)%count($cla))];
Margus
source share