How to quickly convert numbers into text
For example, 1 => one, 2=> two, ..., 15=》Fifteen
What I am currently thinking about is to save Chinese characters into a In array
$arr = ['一','二','三','四','五','六','七','八','九','十'];
But this is too troublesome
How to convert the input numbers into Chinese? Is there an easier way?
代言2017-06-13 09:24:16
Too free,,,,,,,,,,,,,,,,,,,,,,
<?php
$str = 1237124129124;
//将一个字符串转换为数组
$arr = str_split((string)$str,1);
$cns = ['零','一','二','三','四','五','六','七','八','九'];
foreach ($arr as $key) {
echo $cns[$key];
}
//一二三七一二四一二九一二四