一区二区久久-一区二区三区www-一区二区三区久久-一区二区三区久久精品-麻豆国产一区二区在线观看-麻豆国产视频

PHP自動生成月歷代碼

<?php
/* 
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.

Function usage: calendar(Month,Year)
*/

function calendar($MM,$YYYY){
    if($MM=="") $MM = date("m");
    if($YYYY=="") $YYYY = date("Y");
    if(checkdate($MM,1,$YYYY)){
        $stringDate = strftime("%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));
        $lastDay = strftime("%w",mktime (0,0,0,$MM,$days,$YYYY));
        $printDays = $days;
        $preMonth = strftime("%m",mktime (0,0,0,$MM-1,1,$YYYY));
        $preYear = strftime("%Y",mktime (0,0,0,$MM-1,1,$YYYY));
        $nextMonth = strftime("%m",mktime (0,0,0,$MM+1,1,$YYYY));
        $nextYear = strftime("%Y",mktime (0,0,0,$MM+1,1,$YYYY));
        print("<table border=/"1/" cellpadding=/"1/" cellspacing=/"1/">");
        print("<tr><th valign=/"top/"><a href=/"".$_SERVER['php_SELF']."?NB=".$_GET["NB"]."&MM=".$preMonth."&YY=".$preYear."/">P</a></th>");
        print("<th colspan=/"5/" valign=/"top/">".strftime("%b %Y",mktime (0,0,0,$MM,1,$YYYY))."</th>");
        print("<th valign=/"top/"><a href=/"".$_SERVER['php_SELF']."?NB=".$_GET["NB"]."&MM=".$nextMonth."&YY=".$nextYear."/">N</a></th></tr>");
        print("<tr style=/"font-family: Verdana; font-size:x-small/">");
        print("<th>Sun</th><th>Mon</th><th>Tue</th><th>Wed</th><th>Thu</th><th>Fri</th><th>Sat</th></tr>");

        $currentDays = 1;
        for($a=1;$a<=5;$a++){
            print("<tr align=/"left/" valign=/"top/" style=/"font-family: Verdana; font-size:x-small/">");
            $diffDays = $firstDay-$lastDay;
            if($firstDay>$lastDay && $currentDays ==1 && ($diffDays<>1)){
                for($x=$lastDay;$x>=0;$x--){
                    $printDays = $days-$x;
                    print("<td>$printDays</td>");
                }
                for($z=1;$z<$firstDay-$lastDay;$z++){
                    print("<td> </td>");
                }
                for($y=$firstDay;$y<7;$y++){
                    print("<td>$currentDays</td>");
                    $currentDays++;
                }
            } elseif($firstDay!=0 && $currentDays==1){
                for($z=1;$z<=$firstDay;$z++){
                    print("<td> </td>");
                }
                for($y=$firstDay;$y<7;$y++){
                    print("<td>$currentDays</td>");
                    $currentDays++;
                }
            } else {
                for($u=1;$u<=7 && $currentDays<=$days;$u++){
                    print("<td>$currentDays</td>");
                    $currentDays++;
                }
            }
            print("</tr>");
        }
        print("</table>");
    }
}
?>

 

php技術PHP自動生成月歷代碼,轉載需保留來源!

鄭重聲明:本文版權歸原作者所有,轉載文章僅為傳播更多信息之目的,如作者信息標記有誤,請第一時間聯系我們修改或刪除,多謝。

主站蜘蛛池模板: 日本最新免费不卡二区在线 | 久久久久国产一级毛片高清板 | 亚洲综合一区二区不卡 | 天天舔天天射 | 第一区 | 国产日韩精品视频一区二区三区 | 成人a毛片手机免费播放 | 国产1页| 亚洲国产中文字幕在线观看 | 性欧美videosg最新另类 | 女人被爽到呻吟娇喘的视频动态图 | 亚洲国产午夜 | 国产婷婷成人久久av免费高清 | 一区二区三区免费视频观看 | 久久这里有精品视频任我鲁 | 91视频.com| 亚洲免费视频网址 | 成人午夜性视频欧美成人 | 99久久久久国产 | 中文字幕不卡一区 | 国产热视频| 中文字幕一区二区三区精彩视频 | 7777在线视频 | 69国产成人综合久久精品91 | 亚洲激情久久 | 久久综合综合久久 | 东京加勒比2021一区 | 中文字幕色站 | 国产综合色在线视频区 | 国产xxxxx在线播放 | 久久伊人精品热在75 | 久久国产美女免费观看精品 | 亚欧色视频在线观看免费 | 国产亚洲福利精品一区二区 | 欧美一级做 | 久久伊人精品热在75 | 黄色高清在线观看 | 日韩一区二区中文字幕 | 人人洗澡人人洗澡人人 | 国产欧美自拍 | 欧美激情在线精品一区二区 |