一个阿拉伯数字转中文数字的函数

作者:袖梨 2022-07-02
最近因需要,写了个“阿拉伯数字转中文数字的函数”。搜索了精华区只见到一个类似的。
感觉到我的算法不错,所以贴出来共享一下
如果要用于金额的转换,对小数部分的处理要做一下修改
function ch_num($num,$mode=true) {
$char = array("零","壹","贰","叁","肆","伍","陆","柒","捌","玖");
$dw = array("","拾","佰","仟","","孺","

相关文章

精彩推荐