S M T W T F S EOH; echo "\n"; $x = $lastday-$wday+1; if($fweek){ for ($i=$x; $i<=$lastday; $i++) { echo " \n"; } $fweek=false; } $tr_num=1; if($lastday-$x+1==0) $tr_num--; while(checkdate($m_num,$day,$year)){ $day_date=$year.sprintf("%02d%02d", $m_num, $day); $day_diary_log=ddiary_today($uid,$day_date); $today_date=date("Ymd"); $today_date_2 = getdate(); $link = sprintf("%4d%02d%02d", $year, $m_nu