최신글 수정좀 부탁드립니다. 정보
최신글 수정좀 부탁드립니다.
본문
<? for ($i=0; $i<count($list); $i++) { ?>
<? if ($i==0) { ?>
<tr>
<td width=100>1</td>
</tr>
<? } ?>
<? if ($i==1) { ?>
<tr>
<td width=100>2</td>
</tr>
<? } ?>
<? if ($i==2) { ?>
<tr>
<td width=100>3</td>
</tr>
<? } ?>
<? } ?>
위처럼 latest.skin.php 을 만드니,
index 에서 20개를 뽑으려고 했는데, 3개만 뽑네요.
위 마지막 부분에서 나머지 17개를 뽑으려면 어떻게 만들어야하나요?
컴맹이라 죄송요...
<? if ($i==2) { ?>
<tr>
<td width=100>3</td>
</tr>
<? } ?>
<? if ($i==0) { ?>
<tr>
<td width=100>1</td>
</tr>
<? } ?>
<? if ($i==1) { ?>
<tr>
<td width=100>2</td>
</tr>
<? } ?>
<? if ($i==2) { ?>
<tr>
<td width=100>3</td>
</tr>
<? } ?>
<? } ?>
위처럼 latest.skin.php 을 만드니,
index 에서 20개를 뽑으려고 했는데, 3개만 뽑네요.
위 마지막 부분에서 나머지 17개를 뽑으려면 어떻게 만들어야하나요?
컴맹이라 죄송요...
<? if ($i==2) { ?>
<tr>
<td width=100>3</td>
</tr>
<? } ?>
댓글 전체
<? for ($i=0; $i<count($list); $i++) { ?>
<? if ($i==0) { ?>
<tr>
<td width=100>1</td>
</tr>
<? } ?>
<? if ($i==1) { ?>
<tr>
<td width=100>2</td>
</tr>
<? } ?>
<? if ($i==2) { ?>
<tr>
<td width=100>3</td>
</tr>
<? } else { ?>
<tr>
<td width=100>내용</td>
</tr>
<? } ?>
<? } ?>
<? if ($i==0) { ?>
<tr>
<td width=100>1</td>
</tr>
<? } ?>
<? if ($i==1) { ?>
<tr>
<td width=100>2</td>
</tr>
<? } ?>
<? if ($i==2) { ?>
<tr>
<td width=100>3</td>
</tr>
<? } else { ?>
<tr>
<td width=100>내용</td>
</tr>
<? } ?>
<? } ?>
무슨말인지 정확히 이해를 못했습니다....
일단 아래처럼 하시면 될 듯 싶네요.
count($list) 가 만약 25라면 20개까지 찍히고 마쳐 집니다.
20개 이하면 그대로 출력되구요
<table>
<?php
for ($i=0; $i<count($list); $i++) {
if($i>19) break; //0부터 시작하므로..19까지하면 20개가 찍힘
?>
<tr>
<td width=100><?=$i?></td>
</tr>
<? } ?>
</table>
일단 아래처럼 하시면 될 듯 싶네요.
count($list) 가 만약 25라면 20개까지 찍히고 마쳐 집니다.
20개 이하면 그대로 출력되구요
<table>
<?php
for ($i=0; $i<count($list); $i++) {
if($i>19) break; //0부터 시작하므로..19까지하면 20개가 찍힘
?>
<tr>
<td width=100><?=$i?></td>
</tr>
<? } ?>
</table>
저도 뭔말인지 잘,,
<? for ($i=0; $i<count($list); $i++) { ?>
<tr><td><?=$list[$i][subject]?></td></tr>
<? } ?>
그냥 이렇게 하고 index.php 에서
<?=latest("basic", notice, 20, 50);?>
<? for ($i=0; $i<count($list); $i++) { ?>
<tr><td><?=$list[$i][subject]?></td></tr>
<? } ?>
그냥 이렇게 하고 index.php 에서
<?=latest("basic", notice, 20, 50);?>
세분 정말 감사드립니다. ^^
덕분에 해결했습니다. ㅎ
날씨 추운데 몸 조심하세요. ^^
덕분에 해결했습니다. ㅎ
날씨 추운데 몸 조심하세요. ^^