PHP date 함수에서 date("n", strtotime($date)); 이값 출력 하면 지난 day로 출력됩니다. 채택완료
amkorphp
9년 전
조회 5,774
</p><p><span style="font-size: 14.6667px;">$date = "</span><span style="color: rgb(85, 85, 85); font-family: '맑은 고딕', 'Malgun Gothic', 돋움, dotum, 'Segoe UI', sans-serif; font-size: 12px; line-height: normal;">2016-3</span><span style="font-size: 14.6667px; line-height: 1.5;">";</span></p><p> </p><p>$date= date("n월", strtotime($date)); </p><p> </p><p>var_dump(<span style="font-size: 14.6667px; line-height: 1.5;">$date</span><span style="font-size: 11pt; line-height: 1.5;">); // </span><span style="color: rgb(51, 51, 51); font-family: '맑은 고딕', 'Malgun Gothic', 돋움, dotum, 'Segoe UI', sans-serif; font-size: 11px; font-weight: bold; line-height: normal; background-color: rgb(242, 242, 242);">2월 로 출력됩니다 ㅠ,ㅠ</span></p><p><span style="color: rgb(51, 51, 51); font-family: '맑은 고딕', 'Malgun Gothic', 돋움, dotum, 'Segoe UI', sans-serif; font-size: 11px; font-weight: bold; line-height: normal; background-color: rgb(242, 242, 242);">
이거 왜 이런거죠? ㅠ,ㅠ 3월로 출력되어야 하는데 ㅠ,ㅠ
댓글을 작성하려면 로그인이 필요합니다.
답변 4개
답변을 작성하려면 로그인이 필요합니다.
로그인
$date="2016-3"
echo strtotime($date);
유닉스타임으로 변환한 결과 2016-03 은 1456758000 입니다.
이 값이 회원님 서버와 틀리다면 서버담당자 멱살을..