Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

How can i convert English numbers being retrieved from the database to Arabic numeral symbols in PHP.

EDIT: Here're some examples of what Arabic numerals look like. I live in an Arab country, so please don't go around explaining to me what Arabic numerals look like. If you can help, good and well. I don't need bogus ideas.

http://upload.wikimedia.org/wikipedia/commons/thumb/2/21/Arabic_numerals-en.svg/500px-Arabic_numerals-en.svg.png

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
702 views
Welcome To Ask or Share your Answers For Others

1 Answer

If you are referring to what Wikipedia calls eastern arabic / indic numerals, a simple replace operation should do.

$western_arabic = array('0','1','2','3','4','5','6','7','8','9');
$eastern_arabic = array('?','?','?','?','?','?','?','?','?','?');

$str = str_replace($western_arabic, $eastern_arabic, $str);

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...