david212 Posted July 10, 2010 Share Posted July 10, 2010 <? function transl($text) { $onset=implode('|', array('th', 'qu', 'br')); return preg_replace('~('.$onset.'|\w)(\w*)~i', '$2$1ay', $text); } $text = 'here goes text for translate '; echo transl($text); ?> But the problem is that if a word starts with a vowel it is displayed in a different way, i mean only -ay is added, no character rearrangement. How can i solve it. Please help.You can read information here: http://en.wikipedia.org/wiki/Pig_Latin Link to comment https://forums.phpfreaks.com/topic/207351-need-help-with-translation-code/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.