I want to convert arabic characters into english characters.
I want to convert the tile of post in wordpress and transliterate into english characters.
and store it in a variable like $entitle.
how can i do it?
Can please someone help?
if ($this->registry->options['invetag_seotopic_ahmed_php'] AND $zwr_ahmedPHP == "show") {
$en = str_split('{}DFL:"ZCV<>`qwertyuiop[]asdfghjkl;'zxcvnm,./~QWERYIOPASHJKXNM?');
$ar = str_split('<>][/:"~}{,.ذضصثÙÙغعÙØ®ØجدشسÙبÙاتÙÙ
ÙطئءؤرÙØ©ÙزظÙÙÙÙÙإ÷ÃØÙÙØ£ÙØÙØ¢âØ');
for ($ahmedPHP = 0; $ahmedPHP < count($seotopic_thread); $ahmedPHP++) {
$inv_tmp = str_replace($ar, $en, $seotopic_thread[$ahmedPHP]);
$inv_ar_tmp [] = str_replace(array('Ùا', 'ÙØ¢', 'ÙØ£', 'ÙØ¥', 'â'), array('b', 'B', 'G', 'T', 'U'), $inv_tmp);
}
if (is_array($inv_ar_tmp)) {
$invtag = implode(" ", $inv_ar_tmp);
$invtag = '<hr size="1" style="color:#D1D1E1; background-color:#D1D1E1" />' . "<p class="alt2" dir="ltr" style="margin: 1px auto; padding: 6px;border: 1px inset; width: 640px;height: 34px;text-align: left;overflow: auto">" . $invtag . "</p>n";
$post[message] = $post[message] . $invtag;
}
}
you are using str_split fro spliting the arabic multi byte charactors.
you need to use a multibyte function.
eg:
EDIT:
put this function in the ‘functions.php’ file in your theme.
in your theme, you can get the title in english by calling the
arb2en_title() function.
eg:
Note: i have used the buckwalter transliteration chart.
http://www.ldc.upenn.edu/myl/morph/buckwalter.html
EDIT::
for arbic key board mapping like in this link:
http://elfnoon.com/demo/maps.html
replace the arb_en_map array with this:
or you can use the hex mapping array, both are same: