게시판 글번호 역순
본문
<?php
for ($i=0; $i<count($list); $i++) {
?>
-----------------------------------------
<td class="hidden-xs"><?php echo $i+1 ?></td>
이렇게만 올려도 될런지 모르겠는데...;;
지금은 게시판글번호가
1
2
3
4
이런식으로 나오구요..
제가 원하는건 쓸때마다 번호가 위로 올라가게
4
3
2
1
이런식으로 하고싶은데.. 모르겠네요 도와주세요..ㅠ
!-->답변 2
<td
class
=
"hidden-xs"
><?php
echo
$i
+1 ?></td>
=> 아래와 같이 하시면 될거 같습니다.
<td
class
=
"hidden-xs"
><?php
echo
count
(
$list
) -
1 ?></td>
<?php echo $list[$i]['num']; ?>
이미 계산된 값이 있습니다.
답변을 작성하시기 전에 로그인 해주세요.