Home > Backend Development > PHP Tutorial > PHP program to convert China Merchants Bank credit card repayment date into Chinese date

PHP program to convert China Merchants Bank credit card repayment date into Chinese date

WBOY
Release: 2016-07-29 08:33:36
Original
1102 people have browsed it

This program outputs the Chinese date as 2001-12-23, and solves the problem of "ten" very well, such as the processing of "ten" in "Eleven" and "Twenty-one"! It can be changed to a function with slight modifications.
$str="December 23, 2001";
echo $str."

";
$flag=0;
$cn=array("一" ,"two","three","four","five","six","seven","eight","nine","ten","zero","○");
$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 [$ count] =" 1 "; cout];
             $flag=2;break;
}
else
                                                                                                          
The above introduces the PHP program for converting the Chinese date of China Merchants Bank credit card repayment date, including the content of China Merchants Bank credit card repayment date. I hope it will be helpful to friends who are interested in PHP tutorials.


Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template