数字大小写转换PHP代码


<?php 
header("Content-type: text/html; charset=utf-8");
//PHP数字金额转大小格式
function a($a){
    $da_num=array('零','一','二','三','四','五','六','七','八','九');
    return $da_num[$a];
}
function daxie($num){
    $ren=null;
    $len_num = strlen($num);
    if(!is_numeric($num) || $num < 0){
        echo "输入错误!";
    }else{
        for($i=0;$i<$len_num;$i++){
            //substr() 函数返回字符串的一部分。
            $ren.= a(substr($num,$i,1));
        }
        echo $ren;
    }

}
daxie('0123456789');
echo "<br>";
?>


你可能感兴趣的:(数字大小写转换PHP代码)