디자인천일공책

PHP with GNU 첨부파일(이미지) 첫번째 혹은 두번째부터 출력하고 싶을 때

페이지 정보

작성자 디자인천일 작성일Date: 2025-03-29 01:03 조회view: 16

본문

첨부파일(이미지) 별도로 출력

첫번째 파일만 출력.

두번째 파일부터 출력.

php

//첨부파일 첫번째 이미지만 출력
if ($view['file'][0]['view']) {
	echo get_view_thumbnail($view['file'][0]['view']);
}

//두번째 파일부터 출력
$v_img_count = count($view['file']);
if($v_img_count) {
	echo "<div id=\"bo_v_img\">\n";
	for ($i=1; $i<$v_img_count;$i++) {
		if ($view['file'][$i]['view']) {
			echo get_view_thumbnail($view['file'][$i]['view']);
		}
	}
	echo "</div>\n";
}