This program will be the Chinese date output for 2001-12-23, and good to solve the "ten" problems, such as "11" and "21" in the "Ten" Treatment! A slight modification can be changed to a function.
$str = "December 23, 2001";
echo $str. "
";
$flag = 0;
$CN =array ("One", "two", "three", "four", "Five", "VI", "VII", "VIII", "IX", "Ten", "0", "0");
$num =array ("1", "2", "3", "4", "5", "6", "7", "8", "9", "", "0", "0");
$len =strlen ($STR);
for ($i =0; $i < $len; $i +=2)
{
$array _str[$i]=substr ($str, $i, 2);
$cout = 0;
while ($cout
{
if ($array _str[$i]== $cn [$cout])
{
if ($flag ==1)
echo "-";
if (($array _str[$i]== "Ten") and ($flag ==1))
{
$temp [$cout]= "1";
echo $temp [$cout];
$flag =2;break;
}
$temp [$cout]= $num [$cout];
echo $temp [$cout];
$flag = 2;
Break
}
Else
{
if (count ($cn) = = $cout + 1)
$flag = 1;
}
$cout + +;
}
}
?>
The above describes the CMB credit card repayment date to convert the Chinese date of the PHP program, including the CMB credit card repayment date content, I hope that the PHP tutorial interested friends to help.