"; $flag=0; $cn=array("一","二","三","四","五","六","七","八","九","十","零","○"); $num=array("/> "; $flag=0; $cn=array("一","二","三","四","五","六","七","八","九","十","零","○"); $num=array(">

首頁 >後端開發 >php教程 >招行信用卡還款日期 轉換中文日期的PHP程序

招行信用卡還款日期 轉換中文日期的PHP程序

WBOY
WBOY原創
2016-07-29 08:33:361103瀏覽

本程式將中文日期輸出為2001-12-23,並很好解決了「十」的問題,如「十一」和「二十一」中「十」的處理!稍加修改可改為函數。

$str="二零○一年十二月二十三日";
echo $str."

";
$flag=0;
$cn=array("一","二","三","四","五","六","七","八","九","十","零"," ○");
$num=array("1","2","3","4","5","6","7","8","9","" ,"0","0");
$len=strlen($str);
for ($i=0;$i {
$array_str[$i]=substr($str,$i,2);
   $cout=0;
   while($cout   {      {
       if ($flag==1)
      if ($flag==1)
      if ($flag==1)
    i]= ="十") and ($flag==1))
       {
         $temp[$cout]="1";        }
       $temp[$cout]=$num[$cout];
            break;
     }
     else
     {
          }
     $cout++;
   }
}
?> 
以上就介紹了招行信用卡還款日期 轉換中文日期的PHP程序,包括了招行信用卡還款日期方面的內容,希望對PHP教程有興趣的朋友有所幫助。


陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn