Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function huyify($word) {
- mb_internal_encoding('utf-8');
- $huyowels = array(
- 'а'=>'я',
- 'о'=>'ё',
- 'у'=>'ю',
- 'э'=>'е',
- 'ы'=>'и',
- );
- $cons = explode(',','б,в,г,д,ж,з,й,к,л,м,н,п,р,с,т,ф,х,ц,ч,ш,щ');
- if(in_array(mb_substr($word, 0, 1), array_values($huyowels))) {
- $word = 'ху'.$word;
- } elseif (in_array($fletter = mb_substr($word, 0, 1), array_keys($huyowels))) {
- $hl = $huyowels[$fletter];
- $word = 'ху'.$hl.mb_substr($word, 1);
- } elseif (in_array(mb_substr($word, 0, 1), $cons)) {
- $word = huyify(mb_substr($word, 1));
- }
- return $word;
- }
Add Comment
Please, Sign In to add comment