테스트 사이트 - 개발 중인 베타 버전입니다
 

<?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>&nbsp;</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>&nbsp;</td>';

echo '</tr></table>';
?>

[이 게시물은 관리자님에 의해 2011-10-31 17:12:10 PHP & HTML에서 이동 됨]

댓글 작성

댓글을 작성하시려면 로그인이 필요합니다.

로그인하기

댓글 2개

127.0.0.1은 localhost인데 실행이 될리가 없죠

게시판 목록

프로그램

글쓰기