Hi dears.
Mr.Tavakkolian was helping me until my function completed.
This function converts utf8(digit) to integer.
$farsi_table_linux=array("NONE",
"۰",
"۱",
"۲",
"۳",
"۴",
"۵",
"۶",
"۷",
"۸",
"۹");
function search_index_array($str)
{
global $farsi_table;
for ($i=0;$i<11;$i++)
{
if ($farsi_table[$i]==$str )
return $i;
}
return FALSE;
}// end of search_index_array
////////////////////////////////
function utf8_to_int($str)
{
$len=strlen($str);
$out="";
$char=explode(";",$str);
for ($i=0;$i<$len;$i++)
{
$char[$i].=";";
if (search_index_array($char[$i])!=False)
$out.=search_index_array($char[$i])-1;
}//end of for ($i)
return $out;
}//end of utf8_to_int
When i call utf8_to_int("۰"."۹") ,this return 09 ,But When i enter a
number(utf8) via keyboard,This function return 0.
Please guide me that i how enter a number via keyboard(persian) & i get true answer.
--regards
_____________________________________________________________
Thank you for choosing LinuxQuestions.
http://www.linuxquestions.org
_______________________________________________
FarsiWeb mailing list
[EMAIL PROTECTED]
http://lists.sharif.edu/mailman/listinfo/farsiweb