天天躁日日躁狠狠躁AV麻豆-天天躁人人躁人人躁狂躁-天天澡夜夜澡人人澡-天天影视香色欲综合网-国产成人女人在线视频观看-国产成人女人视频在线观看

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自動生成月歷代碼,轉載需保留來源!

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

主站蜘蛛池模板: 爽爽影院免费观看 | 国产成人在线观看免费网站 | 九九九精品国产在线 | 欧美性情video sexo视频 | 国产99久久久欧美黑人刘玥 | 99免费在线 | 性色爽爱性色爽爱网站 | SM调教贱屁股眼哭叫求饶H | 给我免费播放片bd国语 | 久久人妻少妇嫩草AV無碼 | videossex性暴力 | 亚洲精品一区三区三区在线观看 | 两性午夜色视频免费网站 | 最近免费中文字幕MV免费高清 | 一抽一出BGM免费50分动漫 | 99精品无码AV在线播放 | 国产精品69人妻无码久久久 | 恋夜影院支持安卓视频美女 | 国产中文欧美日韩在线 | 国产精品亚洲专一区二区三区 | 亚洲国产在线精品国偷产拍 | 国产AV国片精品无套内谢无码 | 亚洲 制服 欧美 中文字幕 | 久久久乱码精品亚洲日韩 | 免费xxx成年大片 | 99国产强伦姧在线看RAPE | 一二三四在线视频社区 | yellow日本高清在线 | 亚洲爆乳少妇精品无码专区 | 无码成人AAAAA毛片含羞草 | 久久国产av偷拍在线 | 国产精品婷婷五月久久久久 | 国产CHINESE HD精品 | 京香在线观看 | 國產麻豆AVMDXMDX | 久久五月综合婷婷中文云霸高清 | 在线观看成人免费 | 亚洲欧美成人无码久久久 | 综合一区无套内射中文字幕 | 亚洲精品欧美精品中文字幕 | bbw美女与zooxx|