一个比较不错的PHP日历类分享(2)
本例将一个日历程序按功能拆分(周列表部分、日期列表部分、设置日期部分,以及上一年、下一年、上一月和下一月的设置部分)并封装在一个日历类中
本例将一个日历程序按功能拆分(周列表部分、日期列表部分、设置日期部分,以及上一年、下一年、上一月和下一月的设置部分)并封装在一个日历类中。有了日历类,我们还需要再编写一个主程序去加载并输出日历,在主程序中还需要先设置一下日历输出的样式,代码如下所示:
<html>
<head>
<title>恩聪PHP日历示例</title>
<style>
table {border:1px solid #050;}
.fontb {color:white; background:blue;}
th{width:30px;}
td,th{height:30px;text-align:center;}
form{margin:0px; padding:0px;}
</style>
</head>
<body>
<?php
require 'calendar.class.php';
echo new calendar;
?>
</body>
</html>
精彩图集
精彩文章






