may be this help you

function getunicode($str)
        {


            $char_arr['د']='د';
            $char_arr['ج']='ج';
            $char_arr['ح']='ح';
            $char_arr['خ']='خ';
            $char_arr['ه']='ه';
            $char_arr['ع']='ع';
            $char_arr['غ']='غ';
            $char_arr['إ']='إ';
            $char_arr['ف']='ف';
            $char_arr['ق']='ق';
            $char_arr['ث']='ث';
            $char_arr['ص']='ص';
            $char_arr['ض']='ض';
            $char_arr['ش']='ش';
            $char_arr['س']='س';
            $char_arr['ي']='ي';
            $char_arr['ب']='ب';
            $char_arr['ل']='ل';
            $char_arr['ا']='ا';
            $char_arr['ت']='ت';
            $char_arr['أ']='أ';
            $char_arr['ن']='ن';
            $char_arr['م']='م';
            $char_arr['ك']='ك';
            $char_arr['ط']='ط';
            $char_arr['ذ']='ذ';
            $char_arr['ئ']='ئ';
            $char_arr['ء']='ء';
            $char_arr['ؤ']='ؤ';
            $char_arr['ر']='ر';
            $char_arr['ى']='ى';
            $char_arr['آ']='آ';
            $char_arr['ة']='ة';
            $char_arr['و']='و';
            $char_arr['ز']='ز';
            $char_arr['ظ']='ظ';

            $buffer ='';
        $len    = strlen($str);
        for($i=0; $i <= $len; $i++)
            {
                @$chr = $str{$i};
             $buffer.=( @$char_arr[$chr] ? $char_arr[$chr] : $chr );
            }
        return     $buffer;
        }

2008/4/28 Ibrahim Y <[EMAIL PROTECTED]>:

> Hello all,
>
> let's have this piece of code
>
> <?php
> >     function replaceNumbers($str){
> >         $str = str_replace("0" , "&#x0660;" , $str );
> >         $str = str_replace("1" , "&#x0661;" , $str );
> >         $str = str_replace("2" , "&#x0662;" , $str );
> >         $str = str_replace("3" , "&#x0663;" , $str );
> >         $str = str_replace("4" , "&#x0664;" , $str );
> >         $str = str_replace("5" , "&#x0665;" , $str );
> >         *$str = str_replace("6" , "&#x0666;" , $str );*
> >         $str = str_replace("7" , "&#x0667;" , $str );
> >         $str = str_replace("8" , "&#x0668;" , $str );
> >         $str = str_replace("9" , "&#x0669;" , $str );
> >         $str = str_replace("Wednesday" , "الأربعاء" , $str );
> >         $str = str_replace("July" , "تموز" , $str );
> >         return $str;
> >     }
> >
> >     echo replaceNumbers("Wednesday, 07 July 2008");
> > ?>
> >
>
> The output when invoking the function as follow:
>
>    - when removing the line in Bold is ( الأربعاء, ٠٧ تموز ٢٠٠٨ ).
>    - when the line is there the output is (الأربعاء, �٦٦0;٧ تموز
>    �٦٦2;�٦٦0;�٦٦0;٨).
>
> what I want is to replace English numbers into Arabic(hindi) before I
> display them on the page, is there any better way to replace numbers into
> Arabic.
>
> Ibrahim
>
>
> >
>


-- 
M.H.K

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Jordan PHP Users Group" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/JoPHP
http://Jolug.org/
-~----------~----~----~----~------~----~------~--~---

Reply via email to