PHP簡單日曆執行個體

來源:互聯網
上載者:User

<?php
/*
 * PHP簡單日曆執行個體
 * 作者: 多菜鳥
 * 郵箱: kingerq AT msn DOT com
 * 來源: http://blog.111cn.net/kingerq/
 * 建立時間: 2008-01-03
**/

$date = preg_match("/d{4}-d{2}-d{2}/", $_GET["YMD"]) ? $_GET["YMD"] : date( "Y-m-d" );
$thisYear = date( "Y", strtotime( $date) );
$thisMonth = date( "m", strtotime( $date) );
$firstDay = date( "w", strtotime( $thisYear."-".$thisMonth."-01" ) );
$monthNum = date( "t", strtotime( $date) );
?>
<html>
<head>
<title>Calendar</title>
<style type="text/css">
.datehead td{
  background-color: #669966;
  border: 1px solid #4F774F;
  color:#FFFFFF;
  height:30px;
  font-size:18px;
  font-weight:bold;
  text-align:center;
  font-family: Geneva, Arial, Helvetica, sans-serif;
}
.daynormalbg td{
 background-color:#EEEEEE;
 border:solid #dddddd 1px;
 height:100px;
 vertical-align: top;
 width:14%;
}
.daynormalfont div{
 color:#000000;
 font-weight:bold;
 font-size:18px;
 font-family: Geneva, Arial, Helvetica, sans-serif;
}
.sunday{color:#CC0000 !important; }
.saturday{color: #006600 !important;}
.todaybg{
 background-color:#0099FF !important;
 text-decoration: underline;
}
a {font-family:Geneva, Arial, Helvetica, sans-serif; color:#333333; font-size:12px}
a:hover{text-decoration:none;}
</style>
</head>

<body>
<table border="0" align="center" cellpadding="5" cellspacing="0">
  <tr>
    <td>     
 <p><a href="?YMD=<?=date( "Y-m", strtotime( $date." -1 year") )."-01"?>">&lt;&lt;Last Year</a>
        <a href="?YMD=<?=date( "Y-m",

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.