Maison > développement back-end > tutoriel php > php简单日历的实现代码(可绑定事件)

php简单日历的实现代码(可绑定事件)

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Libérer: 2016-07-25 08:56:05
original
1606 Les gens l'ont consulté
  1. /**
  2. * php简单日历
  3. * edit: bbs.it-home.org
  4. */
  5. if(empty($year))$year=date("Y"); //初始化年份
  6. if(empty($month))$month=date("n"); //初始化月份
  7. $wd_ar=array("日","一","二","三","四","五","六"); //星期数组
  8. $wd=date("w",mktime(0,0,0,$month,1,$year)); //当月第一天是星期几
  9. //年链接
  10. $y_lnk1=$year$y_lnk2=$year>=2037?$year=2037:$year+1;
  11. //月链接
  12. $m_lnk1=$month$m_lnk2=$month>=12?$month=12:$month+1;
  13. echo
  14. EOT;
  15. for($i=0;$iprint "
  16. ";
  17. }
  18. print "
  19. ";
  20. $tnum=$wd+date("t",mktime(0,0,0,$month,1,$year));
  21. for($i=0;$i$date=$i+1;
  22. if($i%7==0) print '
  23. ';
  24. print '
  25. ";
  26. if($i%7==6) print "
  27. ";
  28. }
  29. if($i%70) print '
  30. ';
  31. if($i%7==6) print "
  32. ";
  33. print '
  34. $year 年 > $month 月 >
    $wd_ar[$i]
    ';
  35. if($i>=$wd) print $date-$wd;
  36. print "
  37. ';
  38. ?>
复制代码

很简单吧,以上就是本节介绍的php日历代码,实现了基本日历的一些功能:年份、月份、日期、星期的显示。

>>> 您可能感兴趣的文章: php calender日历代码(解决2038问题) php日历代码(附演示效果) php日历代码分享 简单实用的php日历代码 php日历代码 php实现的高效日历代码 php日历代码 三个不错的php日历代码 分享一例PHP简单日历代码



Déclaration de ce site Web
Le contenu de cet article est volontairement contribué par les internautes et les droits d'auteur appartiennent à l'auteur original. Ce site n'assume aucune responsabilité légale correspondante. Si vous trouvez un contenu suspecté de plagiat ou de contrefaçon, veuillez contacter admin@php.cn
Tutoriels populaires
Plus>
Derniers téléchargements
Plus>
effets Web
Code source du site Web
Matériel du site Web
Modèle frontal