이번 달 달력 출력 정보
PHP 이번 달 달력 출력본문
<?php
define( 'wlen', 7);
list( $now_yy, $now_mm, $now_dd)=explode( '-', date('Y-m-d')); //echo $now_yy,$now_mm,$now_dd;
list( $wpos, $mlast)=explode( '-', date('w-t', mktime( 0, 0, 0, $now_mm, 1, $now_yy))); //mktime: any arguments thus omitted will be set to the current value according to the local date and time.
$wpos=(int)$wpos;
$mlast=(int)$mlast;
echo'<table border="1"><tr>';
for( $wi=0; $wi < $wpos; $wi++) echo '<td> </td>';
for( $di=1; $di<= $mlast; $wi++, $di++) {
if( $wi%wlen==0)echo'</tr><tr>';
echo '<td>',$di,'</td>';
}
for( $ri=$wi%wlen; $ri<wlen; $ri++) echo '<td> </td>';
echo '</tr></table>';
?>
[이 게시물은 관리자님에 의해 2011-10-31 17:12:10 PHP & HTML에서 이동 됨]
추천
0
0
댓글 2개
^^;;
127.0.0.1은 localhost인데 실행이 될리가 없죠