电脑安全

您当前的位置:主页 > 电脑安全 >

PHP简单日历实例-网络编程

来源:[db:来源]标题:   菜鸟    编辑:电脑技术全能网 时间:2019-09-22 06:22

原标题:PHP简单日历实例-网络编程
   <?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",