Ec (2); www.111cn.net? Actionviewspaceitemid29112.html & nbsp; for example, input 7, print 7; 123, print one hundred and twenty-three; 142505588, print 0.1 billion 42,505,588. It took me one night to figure it out --! $ Num & nbsp; & quot; 142505588 & quot; nine-digit * these two scripts ec (2); script
Http://www.111cn.net /? Action/viewspace/itemid/29112.html
For example, input 7, print 7; 123, print one hundred and twenty-three; 142505588, print 0.1 billion 42,505,588
It took me one night to figure it out --!
$ Num = "142505588"; // nine-digit
/*
These two functions are rewritten using built-in functions and arrays.
Function del0 ($ num) // remove 0 from the front of the number segment
{
$ Flag = 0;
$ Str = '''';
For ($ I = 0; $ I {
If ($ num {$ I }== '0' & $ flag = 0)
Continue;
Elseif ($ num {$ I }! = '0 '')
{
$ Str = $ str. $ num {$ I };
$ Flag = 1;
} Else {
$ Str = $ str. $ num {$ I };
}
}
Return $ str;
}
Function n2c ($ x) // change a single digit to a Chinese character
{
Switch ($ x)
{
Case ''0'': $ ch = ''0''; break;
Case ''1'': $ ch = ''1''; break;
Case ''2': $ ch = ''2'; break; </