get_file 질문입니다. 채택완료
김가경
4년 전
조회 1,736
게시판 리스트에서
</p>
<p><?php for ($i=0; $i<count($list); $i++) {
$file = get_file($bo_table, $list[$i]['wr_id']);</p>
<p>
통하여 게시물을 이미지를 불러오는 코드를 작성하였는데
이미지가 5번째 이미지 이후로 똑같은 이미지가 출력이되는데
어떤부분이 잘못된걸까요...
리스트상에는 10개가 출력되도록 하였는데
img1 img2 img3 img4 img5
img6 img6 img6 img6 img6
해당처럼 출력이됩니다..
도무지 원인을 찾을수없어서 남깁니다 ㅠ
댓글을 작성하려면 로그인이 필요합니다.
답변 1개
답변을 작성하려면 로그인이 필요합니다.
로그인
<?php for ($i=0; $i<count($list); $i++) {
$file = get_file($bo_table, $list[$i]['wr_id']);
echo $file[$i]['file']; echo "<br>";
if(preg_match("/\.({$config['cf_image_extension']})$/i", $file[$i]['file'])) {
//echo $file[$i]['file'];
$file_src0 = '<img src="'.$file[0]['path'].'/'.$file[0]['file'].'" width=380px height=375px>';
$file_src1 = '<img src="'.$file[1]['path'].'/'.$file[1]['file'].'" width=380px height=375px>';
$file_src2 = '<img src="'.$file[2]['path'].'/'.$file[2]['file'].'" width=380px height=375px>';
$file_src3 = '<img src="'.$file[3]['path'].'/'.$file[3]['file'].'" width=380px height=375px>';
$file_src4 = '<img src="'.$file[4]['path'].'/'.$file[4]['file'].'" width=380px height=375px>';
$file_src5 = '<img src="'.$file[5]['path'].'/'.$file[5]['file'].'" width=380px height=375px>';
}
?>
<?php //echo $file_src0;?> <br>
<?}?>
[/code]
이렇게 출력했을때 경로가 6개밖에 출력이 되지않습니다 ㅠ