Hello

Say I have a document which is written in phonetic. Now I want to make this indic. How can I do that

Say
A will be আ
B will be ব
AA will be আ
Ba will be বা
T will be ট
t will be ত
etc......

Please help me

Hello

Say I have a document which is written in phonetic. Now I want to make this indic. How can I do that

Say
A will be আ
B will be ব
AA will be আ
Ba will be বা
T will be ট
t will be ত
etc......

Please help me

$alpha = array("A","B","AA");
$indic = array("আ","ব","আ");
$message = str_replace($alpha,$indic,$message);

Just fill the rest in $alpha and $indic.

I'd use preg_replace. I believe there was an option not to break the UTF strings.
I think the option was "u"
.e.g
preg_replace('#A#siu', 'আ', $str);

$alpha = array("A","B","AA");
$indic = array("আ","ব","আ");
$message = str_replace($alpha,$indic,$message);

Just fill the rest in $alpha and $indic.

Thank you but I need advance for example
ABaT will be আবাট
ABat will be আবাত

Then what should I do. Thank You

Is there a particular pattern to the replacement?
Usually languages are based on sentence base translation, then word translation, then alphabetic translation, as this is the most reliable way, however you will need an extensive dictionary to cover the entire language, perhaps see if there is a prebuilt translator?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.