Hi daers.
Mohsen Pahlevanzadeh studing computer in my university.
Mohsen Pahlevanzadeh wrote a function what converts utf8 to digit.
It means that you enter 30(farsi),this function return 30(latin).
Then you can corprate this number in computing.
He tested with RedHat 9 with iranian keyboard layout.
He told me that he don't know that this function work with IE.
He tested on Mozilla & got true answer.
I tesed on IE but i got false answer.
Of course,I don't know PHP or webprogramming.
I ask you test this function on IE & tell me your answer.
If your answer will become true,tell me how to its usage.
Becuse i need to this function.
You can see that function in following lines:
<?php
$farsi_table=array("4758678", "38354955555459", #Zero
"38354955555559", #one
"38354955555659", #two
"38354955555759", #three
"38354955564859", #four
"38354955564959", #five
"38354955565059", #six
"38354955565159", #seven
"38354955565259", #eight
"38354955565359" #nine
);
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)
{
global $farsi_table;
$len=strlen($str);# / 7;
$char=unpack("C*",$str);
$out="";
for ($i=0;$i<$len;$i++)
{
$tmp=$char[$i].$char[$i+1].$char[$i+2].$char[$i+3].$char[$i+4].$char[$i+5].$char[$i+6];
if (search_index_array($tmp)!=False)
$out.=search_index_array($tmp)-1;
}
return (int)$out;
}
?>
Mohsen Pahlevanzadeh studing computer in my university.
Mohsen Pahlevanzadeh wrote a function what converts utf8 to digit.
It means that you enter 30(farsi),this function return 30(latin).
Then you can corprate this number in computing.
He tested with RedHat 9 with iranian keyboard layout.
He told me that he don't know that this function work with IE.
He tested on Mozilla & got true answer.
I tesed on IE but i got false answer.
Of course,I don't know PHP or webprogramming.
I ask you test this function on IE & tell me your answer.
If your answer will become true,tell me how to its usage.
Becuse i need to this function.
You can see that function in following lines:
<?php
$farsi_table=array("4758678", "38354955555459", #Zero
"38354955555559", #one
"38354955555659", #two
"38354955555759", #three
"38354955564859", #four
"38354955564959", #five
"38354955565059", #six
"38354955565159", #seven
"38354955565259", #eight
"38354955565359" #nine
);
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)
{
global $farsi_table;
$len=strlen($str);# / 7;
$char=unpack("C*",$str);
$out="";
for ($i=0;$i<$len;$i++)
{
$tmp=$char[$i].$char[$i+1].$char[$i+2].$char[$i+3].$char[$i+4].$char[$i+5].$char[$i+6];
if (search_index_array($tmp)!=False)
$out.=search_index_array($tmp)-1;
}
return (int)$out;
}
?>
--Yours,Shahnaz.
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
_______________________________________________ FarsiWeb mailing list [EMAIL PROTECTED] http://lists.sharif.edu/mailman/listinfo/farsiweb