Guest User

Untitled

a guest
Oct 19th, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1.  
  2. function huyify($word) {
  3. mb_internal_encoding('utf-8');
  4. $huyowels = array(
  5. 'а'=>'я',
  6. 'о'=>'ё',
  7. 'у'=>'ю',
  8. 'э'=>'е',
  9. 'ы'=>'и',
  10. );
  11. $cons = explode(',','б,в,г,д,ж,з,й,к,л,м,н,п,р,с,т,ф,х,ц,ч,ш,щ');
  12. if(in_array(mb_substr($word, 0, 1), array_values($huyowels))) {
  13. $word = 'ху'.$word;
  14. } elseif (in_array($fletter = mb_substr($word, 0, 1), array_keys($huyowels))) {
  15. $hl = $huyowels[$fletter];
  16. $word = 'ху'.$hl.mb_substr($word, 1);
  17. } elseif (in_array(mb_substr($word, 0, 1), $cons)) {
  18. $word = huyify(mb_substr($word, 1));
  19. }
  20. return $word;
  21. }
Add Comment
Please, Sign In to add comment