<?php
           

$str_2='90001';
    $array1=array('','十','百','千','万');
    $array2=array('零','一','二','三','四','五','六','七','八','九');
    $co=strlen($str_2);
    $str=strrev($str_2);
    $str_end='';
    for($i=0;$i<$co;$i++){
        $s=substr($str, $i, 1);
        $s_last=2;
        $s_last=(substr($str, $i-1, 1)==0||$i==0)?1:2;
        if($i==$co-1&&$s==0){
            return false;
        }
        if($s==0){
            if($s_last&&$s_last==1){
            }else{
                $str_end=$array2[$s].$str_end;
            }
        }else{
            $str_end=$array2[$s].$array1[$i].$str_end;
        }               
    }            
    $str_end.='元';
    echo $str_end;    

?>