/*********************數字轉漢字***********************/
function del0($num) //去掉數字段前面的0
{
return "".intval($num);
function n2c($x) //單一數字變漢字
{
$arr_n = array("零","一","二","三"," "六","七","八","九","十");
function num_r($abcd) //讀取數值(4位元)
{
//echo $ch;
//echo "
";
if($ch == "零" && $flag == 0){ //如果是第一個零
$flag = 1; //該位元為零
$str = $str.
continue; }elseif($ch == "零"){ //如果不是第一個零了$flag = 0; //該位元不是零
switch( $j) {
case 0: $str = $ch; $flag_end = 0; break; //第一位(結尾),不以"零度".$str; break; //第二位
case 2: $str = $ch."百".$str; break; //第三位
".$str; break; //第四位
}
}
if($flag_end == 1) //若以"零」結束hhhh7% F-8");
$str = mb_substr($str, 0, mb_strlen($str)-1); //把"零"去掉
}
if($arrlen==== 2 & $arr== {
$str = substr($str,2);
}
return $str;
}
function num2ch; = del0($num);//去掉前面的"0" $numlen = strlen($num_real); //echo "numlen=".$numlen."
$c = num_r(del0($y))."億";
}elseif($numlen = 5) //若大於
{
$wsbq = substr($num_real, 0, $numlen-4);
0($gsbq));
$b = num_r(del0($wsbq))."萬";
$c="";
} gsbq = substr( $num_real, -$numlen);
$a = num_r(del0($gsbq));
$b=""; $c.$b.$a;
return $ch_num;
}
/******************數字轉漢字結束********************/