首頁 >後端開發 >php教程 >PHP自動產生月曆程式碼_PHP教程

PHP自動產生月曆程式碼_PHP教程

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB原創
2016-07-21 16:09:16779瀏覽

/* 
Function Written by Nelson Neoh @3/2004. 
For those who wants to utilize this code, please do not remove this remark. 
If you have done any enhancement to this code, please post the copy at http://www.dev-club.com PHP board.  Thank you.

函數行事曆(月,年)
*/

函數行事曆($MM,$YYYY){
    if($MM=="") $MM = date( "m ");
    if($YYYY=="") $YYYY = date("Y");
    if(checkdate($MM,1,$YYYY)){ "%d %b %Y",mktime (0,0,0,$MM,1,$YYYY));
        $days = strftime("%d",mktime (0,0,0, $MM 1,0,$YYYY));
        $firstDay = strftime("%w",mktime (0,0,0,$MM,1,$YYYY));
    w",mktime (0,0,0,$MM,$days,$YYYY));
        $printDays = $days;
      0,$MM-1,1,$YYYY));
        $preYear = strftime("%Y",mktime (0,0,0,$MM-1,1,$YYYYY));
$nextMonth = strftime("%m",mktime (0,0,0,$MM 1,1,$YYYY));
        $nextYear = strftime("%Y",mktime (0,0, 0, $MM 1,1,$YYYY));
        print("

");
      ="top">P");
        print("");
        print("") ;
        print("");
        print("");

        $currentDays = 1 ;
     =1;$a            print("") ;
            $diffDays = $firstDay-$lastDay;
                       for($x=$lastDay; $x>=0;$x--){
                   $printDays = $days-$x;
   td>");
                }
for($z=1;$z                    print("
;");
               }
                     print("");
                   . >               }
            } elseif($firstDay!=0 &&¤tDays==1){                    列印(「 ");
                }
                for($y=$firstDay;$y                         $currentDays ;
             >            } else {
                for($u=1;$u$currentDays ;”) ;
                    $currentDays ;
                      print("");
        }
       >}
? >

 




http://www.bkjia.com/PHPjc/314607.html

www.bkjia.com

true

http: //www.bkjia.com/PHPjc/314607.htmlTechArticle?php /* 函式由Nelson Neoh @3/2004 所寫。對於想要使用此程式碼的人,請不要刪除此註解。如果您對此程式碼進行了任何增強,請...
".strftime( "%b %Y",mktime (0 ,0, 0,$MM,1,$YYYY))." N
週日 週一 週二 週三 星期四 星期五 星期六
 $currentDays
陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn