一区二区久久-一区二区三区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技術(shù)PHP生成月歷代碼,轉(zhuǎn)載需保留來源!

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

主站蜘蛛池模板: 男女视频在线观看免费高清观看 | 亚洲精品亚洲人成在线播放 | 激情www | 色在线综合 | 超清乱人伦中文视频在线 | 国产成人小视频 | 国产精品香蕉成人网在线观看 | 欧美日韩国产在线观看一区二区三区 | 美女被男人桶免费网站 | 国产手机在线 | 一个色亚洲 | 国产成人精品午夜二三区 | 在线观看国产福利 | 五月天婷婷色综合 | 韩国一级爽快片淫片高清 | 激情五月婷婷综合 | 日韩在线资源 | 中文字幕佐山爱一区二区免费 | 91视频青娱乐 | 色友视频| 黄色在线观看网站 | a级精品国产片在线观看 | 免费国产一区二区三区 | 色五月婷婷成人网 | 欧美三级免费观看 | 91精品国产综合久久久久久 | 免费人成在线视频播放2022 | 日韩中文精品亚洲第三区 | 亚洲黄色小说视频 | 日韩三级一区二区 | 国产在线观看麻豆91精品免费 | 在线观看 一区 | 久久亚洲网站 | 欧美日韩亚洲国产精品一区二区 | 亚洲一级毛片视频 | 色老板在线永久免费视频凹凸 | 999国内精品永久免费视频 | 久久免费视频3 | 成人怡红院视频在线观看 | 国产欧美曰韩一区二区三区 | 国产成人国产在线观看入口 |