1. [文件] php月历类
_CurrMon= isset($_GET['mon'])?$_GET['mon']: date('n');
$this->_MonNum=array(31,30,31,30,31,30,31,31,30,31,30,31);
$this->_WeekNum=array('日','一','二','三','四','五','六');
$this->_url= $this->GetUrl();
$this->_FirstDay= getdate(mktime(0,0,0, $this->_CurrMon,1, date('Y')));
$this->Two();
$this->_LastDay= $this->_MonNum[$this->_CurrMon-1];
$this->_MonWeekSum= $this->MonWeekSum();
}
//返回连接
private function GetUrl(){
$_url=$_SERVER['REQUEST_URI'];
$_arr= parse_url($_url);
parse_str($_arr['query'],$_QueryArr);
unset($_QueryArr['mon']);
$_str= http_build_query($_QueryArr);
return $_arr['path'].'?'.$_str.'&mon=';
}
//返回二月份天数
private function Two(){
if(date('L')){
return $this->_MonNum[1]=29;
}else{
return $this->_MonNum[1]=28;
}
}
//返回每月的星期数
private function MonWeekSum(){
return ceil(($this->_LastDay+$this->_FirstDay['wday'])/7);
}
//上月
private function PreMon(){
if($this->_CurrMon>1){
return "<<";
}
}
private function NextMon(){
if($this->_CurrMon<12){
return ">>";
}
}
//月历
private function Mon(){
echo "| ".$this->PreMon().' '.date("Y").' 年 '.$this->_CurrMon.' 月 月历 '.$this->NextMon()." | ||||||
| {$_arr1} | "; } echo "||||||
|   | "; $this->_FirstDay['wday']--; }else{ if($this->_BiaoJi==date('j')){ echo "{$this->_BiaoJi} 阳历".$this->_CurrMon."月".$this->_BiaoJi."号"." | ";
}else{
echo "{$this->_BiaoJi} 阳历".$this->_CurrMon."月".$this->_BiaoJi."号"." | ";
}
$this->_BiaoJi++;
}
}
echo "||||
2. [文件] php月历类 ~ 70KB











