Given an ASCII string, replace all ASCII chars with their Cyrillic equivalents
Why a recursive function for such a simple task?

$in = 'This is your input';
$map = 'your char translation array here';
$out = '';
for($i = 0; $i &lt; strlen($in); $i++) {
   $char = $in[$i];
   if (isset($map[$char])) {
       if (is_array($map[$char])) {
           $newchar = $map[$char][0]; // whatever your multi-char selection logic is...
       } else
           $newchar = $map[$char];
       }
       $out .= $newchar;
   }
}