Jump to content

need help with translation code


david212

Recommended Posts

<?

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.