첨부이미지가 1개이상일때 채택완료
달콤이쨈
11년 전
조회 5,283
<?
for ($p=0; $p<count($list[$i][file]); $p++) {
// 이미지 체크
$image = urlencode($list[$i][file][$p][file]);
$ori="$g4[path]/data/file/$bo_table/" . $image;
$ext = strtolower(substr(strrchr($ori,"."), 1)); //확장자
// 이미지가 있다면.
if ($ext=="gif"||$ext=="jpg"||$ext=="jpeg"||$ext=="png"||$ext=="bmp"||$ext=="tif"||$ext=="tiff") {
// 섬네일 경로 만들기 + 섬네일 생성
$list_img_path = $list[$i][file][$p][path]."/".$list[$i][file][$p][file];
$list_thumb = thumbnail($list_img_path , 360, 320,0,1,100);
//echo "<span >";
echo "<a href=";
echo $list[$i][comment_href];
echo " target='_self'>";
echo "<img src='$list_thumb' width='100%' style=' border:0px solid grey; padding:0px; ' />";
echo "</a>";
//echo "</span>";
}
}
?>
이렇게 썸네일 불러다가 쓰는데
목록에서 이미지를 불러와서 쓰고있습니다.,
이미지를 1개이상 올렸을때는
목록에서 1개만 표시하고 싶은데
2개 올렸다고 치면
2개 다뜨네요.ㅠ
어떻게해야할까요?
댓글을 작성하려면 로그인이 필요합니다.
답변 1개
답변을 작성하려면 로그인이 필요합니다.
로그인