日历/月历 这里有:http://www.51windows.net/myjs/?u=/myjs/JsList.asp 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 给我写信,我发给你一个。[email protected] 就是说我要的 <- 12-06 12-07 12-08 12-09 12-10 12-11 12-12 ->我一点左边的箭头就列出七天前的日期,一点右边箭头就列出七天后的日期 <?php /* PHP自动生成月历代码共享Function Written by Nelson Neoh @3/2004. For those who wants to utilize this code, please do not remove this re. 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($YY=="") $YY = 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\" width=220>"); print("<tr><th valign=\"top\"><a href=\"".$_SERVER['PHP_SELF']."?NB=".$_GET["NB"]."&MM=".$preMonth."&YY=".$preYear."\"><img src=images/leftarrow.png border=0></a></th>"); print("<th colspan=\"5\"><font size=2>".strftime("%Y年%m月",mktime (0,0,0,$MM,1,$YYYY))."</font></th>"); print("<th valign=\"top\"><a href=\"".$_SERVER['PHP_SELF']."?NB=".$_GET["NB"]."&MM=".$nextMonth."&YY=".$nextYear."\"><img src=images/rightarrow.png border=0></a></th></tr>"); print("<tr style=\"font-family: Verdana; font-size:x-small\">"); print("<th>日</th><th>一</th><th>二</th><th>三</th><th>四</th><th>五</th><th>六</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 align='center' width=14%><a href=reserve.php?date=$YY$MM$printDays>$printDays</a></td>"); } for($z=1;$z<$firstDay-$lastDay;$z++){ print("<td align='center' width=14%> </td>"); } for($y=$firstDay;$y<7;$y++){ print("<td align='center' width=14%><a href=reserve.php?date=$YY$MM$currentDays>$currentDays</a></td>"); $currentDays++; } } elseif($firstDay!=0 && $currentDays==1){ for($z=1;$z<=$firstDay;$z++){ print("<td align='center' width=14%> </td>"); } for($y=$firstDay;$y<7;$y++){ print("<td align='center' width=14%><a href=reserve.php?date=$YY$MM$currentDays>$currentDays</a></td>"); $currentDays++; } } else { for($u=1;$u<=7 && $currentDays<=$days;$u++){ print("<td align='center' width=14%><a href=reserve.php?date=$YY$MM$currentDays>$currentDays</a></td>"); $currentDays++; } //在这里加入以下两行while($u++ <=7) print("<td> </td>"); } print("</tr>"); } print("</table>"); } //} ?>这个函数请问怎么改才能让是星期日的日期的颜色为红色,而当前日期是黄色??谢谢 linux 下php创建文件夹和文件 用预处理就插入不了数据 这个为什么不能运行,会报错!~ 诚聘php工程师->上海 mysql大数据的备份与恢复工具下载 为什么这段程序不能更新数据库? 一个小问题:安装Apache2 网站上传后出现的错误 请问这是什么原因? nginx rewrite疑问 有人用过PHP5的threads库吗?可以让PHP像JAVA一样支持可控的多线程编程,实现高性能计算,希望版主置顶讨论 PREG如何设置不匹配某个字符串?
我一点左边的箭头就列出七天前的日期,一点右边箭头就列出七天后的日期
/* PHP自动生成月历代码共享
Function Written by Nelson Neoh @3/2004.
For those who wants to utilize this code, please do not remove this re.
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($YY=="") $YY = 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\" width=220>");
print("<tr><th valign=\"top\"><a href=\"".$_SERVER['PHP_SELF']."?NB=".$_GET["NB"]."&MM=".$preMonth."&YY=".$preYear."\"><img src=images/leftarrow.png border=0></a></th>");
print("<th colspan=\"5\"><font size=2>".strftime("%Y年%m月",mktime (0,0,0,$MM,1,$YYYY))."</font></th>");
print("<th valign=\"top\"><a href=\"".$_SERVER['PHP_SELF']."?NB=".$_GET["NB"]."&MM=".$nextMonth."&YY=".$nextYear."\"><img src=images/rightarrow.png border=0></a></th></tr>");
print("<tr style=\"font-family: Verdana; font-size:x-small\">");
print("<th>日</th><th>一</th><th>二</th><th>三</th><th>四</th><th>五</th><th>六</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 align='center' width=14%><a href=reserve.php?date=$YY$MM$printDays>$printDays</a></td>");
}
for($z=1;$z<$firstDay-$lastDay;$z++){
print("<td align='center' width=14%> </td>");
}
for($y=$firstDay;$y<7;$y++){
print("<td align='center' width=14%><a href=reserve.php?date=$YY$MM$currentDays>$currentDays</a></td>");
$currentDays++;
}
} elseif($firstDay!=0 && $currentDays==1){
for($z=1;$z<=$firstDay;$z++){
print("<td align='center' width=14%> </td>");
}
for($y=$firstDay;$y<7;$y++){
print("<td align='center' width=14%><a href=reserve.php?date=$YY$MM$currentDays>$currentDays</a></td>");
$currentDays++;
}
} else {
for($u=1;$u<=7 && $currentDays<=$days;$u++){
print("<td align='center' width=14%><a href=reserve.php?date=$YY$MM$currentDays>$currentDays</a></td>");
$currentDays++;
}
//在这里加入以下两行
while($u++ <=7)
print("<td> </td>");
}
print("</tr>");
}
print("</table>");
}
//}
?>
这个函数请问怎么改才能让是星期日的日期的颜色为红色,而当前日期是黄色??谢谢