최근게시물 날짜 표기시 줄바꿈 할 수 있나요 ?
본문
<?php echo date("m.dY", strtotime($list[$i]['wr_datetime'])) ?>
이 코드를 이용해서 월일년으로 표기되게는 만들었는데요~
년도가 밑으로 떨어지게 하고싶은데 어떻게 해야할까요??
그리고 날짜랑 년도에 스타일도 좀 다르게 주고싶은데... class 주는건 불가능할까여?
답변 2
<span class="aa"><?php echo date("m", strtotime($list[$i]['wr_datetime'])) ?></span>
.
<span class="bb"><?php echo date("d", strtotime($list[$i]['wr_datetime'])) ?></span>
<div><?php echo date("Y", strtotime($list[$i]['wr_datetime'])) ?></div>
<?php echo date("m", strtotime($list[$i]['wr_datetime'])) ?>
<?php echo date("dY", strtotime($list[$i]['wr_datetime'])) ?>
이런식으로 따로 출력하고 태그로 감싸 css나 클래스를 줄 수 있습니다.
답변을 작성하시기 전에 로그인 해주세요.