javascript的不是很多吗??
为什么一定要PHP的呢??

解决方案 »

  1.   

    哈哈,你运气好,我找到一个。
    http://netschool.tiandinet.com/code_showcode.php?codeid=2
      

  2.   

    <?php
    /**
     * 功能函数
     * 用于调用产生月历
     * 引用格式 {date_box:"背景色","字色","高度色","标题色"}
     **/
    function smarttemplate_extension_date_box($bg="#000000", $color="#cfcfcf", $height="", $title="") {
    $a = array_merge(array_fill(0,$w=date("w",mktime(0,0,0,date("m"),1,date("Y")))," "),range(1,$d=date("t")),array_fill(0,(7-($w+$d)%7)%7," "));
    $n = date("j");
    foreach($a as $k=>$v) {
    if($v == $n)
    $a[$k] = "<font color=red>{$a[$k]}</font>";
    $a[$k] = "<td>{$a[$k]}</td>";
    }
    $ar = array_chunk($a,7);
    $s = "<table cellpadding=0 cellspacing=1>";
    $s .= "<colgroup align=right span=7>";
    $s .= '<tr bgcolor="#000000" style="color:#cfcfcf"><th>日</th><th>一</th><th>二</th><th>三</th><th>四</th><th>五</th><th>六</th></tr>';
    foreach($ar as $v)
    $s .= "<tr>".join("",$v)."</tr>";
    $s .= "</table>";
    return $s;
    }
    ?>