오늘은 대한입니다.
sun's longitude:299 48 51.54 
· 자유게시판 · 묻고답하기 · 알파문서 · RPMS list
· 사용자문서 · 팁/FAQ모음 · 리눅스Links · 자료실
· 서버정보 · 운영자 · Books/FAQ · FreeBSD
/board/delete.php:소스보기  
알파문서
자주 잊어먹거나, 메모해 둘 필요성이 있는 팁이나 문서, 기타 등등
[*** 쓰기 금지단어 패턴 ***]
글 본문 중간에 업로드할 이미지를 추가하는 방법 : @@이미지이름@@
ex) @@foo.gif@@
 ★ 글 지우기 항목입니다. 한번 더 생각하시고 결정하십시오.!!!
제목 202 : [PHP] 해당 주(week)의 날짜 찾기
 이름  산이 [홈]http://linuxchannel.net/
[PHP] 해당 주(week)의 날짜 찾기

## find a day of the n'th week in month
## $n = 1'th week, 2nd week, . n'th week
## $w = Sunday(0), Monday(1), ... Saturday(6)
## default) find a day of the first week of sunday in this month
##
function day_of_week_in_month($n=1, $w=0, $month=0, $year=0)
{
if($n < 1) $n = 1;
if($w<0 || $w>6) $w = 0;
if(!$month) $month = date('m');
if(!$year) $year = date('Y');

$week = date('w',mktime(1,0,0,$month,1,$year));
$sunday = ($week==0) ? 1 : (8-$week); // day of first sunday

$day = ($sunday+$w) + ($n-1)*7;

return $day;
}

echo day_of_week_in_month(2,1); // 현재달의 두번째주 월(1)요일은 며칠?
2009년 04월 03일 19:40:17 금(저녁)  from 114.111.62.248
0
암호: 공용 보안 SSL 서버가 준비되기 전까지는 off 합니다

apache lighttpd linuxchannel.net 
Copyright 1997-2026. linuxchannel.net. All rights reserved.

Page loading: 0.01(server) + (network) + (browser) seconds