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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.