게시판 리스트에서 확장필드 출력방법문의 채택완료
클립
10년 전
조회 2,446
wr_4 필드를 아래와 같은 형태로 쪼개서 데이터를 입력받았습니다.
게시판 리스트에서 일부(ext4_01,ext4_02)를 불러와서 출력시키고싶은데 어떻게 해야하나요?
$ex4_filed = explode("|",$list[$i]['wr_4']); $ext4_00 = $ex4_filed[0]; $ext4_01 = $ex4_filed[1]; $ext4_02 = $ex4_filed[2]; $ext4_03 = $ex4_filed[3]; $ext4_04 = $ex4_filed[4]; ?>
댓글을 작성하려면 로그인이 필요합니다.
답변 3개
채택된 답변
+20 포인트
10년 전
http://sir.co.kr/bbs/profile.php?mb_id=leyn83" target="_blank">"클립"님이 위에 제시한 소스를 for 문 안에 넣으셨나요?
해당 소스가 아래처럼 for 문에 있다면 "세모네모"님의 코드가 출력되어야 하는게 정상입니다.
wr_4 필드에 (값a|값b|값c|값d|값e) 이런 내용의 값이 있다고 가정할 때
</p><p><?php
for ($i=0; $i<count($list); $i++) {</p><p> $ex4_filed = explode("|",$list[$i]['wr_4']);
$ext4_00 = $ex4_filed[0];
$ext4_01 = $ex4_filed[1];
$ext4_02 = $ex4_filed[2];
$ext4_03 = $ex4_filed[3];
$ext4_04 = $ex4_filed[4];</p><p> </p><p> echo <span style='color: rgb(72, 72, 72); line-height: 25.2px; font-family: "돋움", Dotum, sans-serif; font-size: 14px;'>$ext4_01; // 값b 출력</span></p><p> echo <span style='color: rgb(72, 72, 72); line-height: 25.2px; font-family: "돋움", Dotum, sans-serif; font-size: 14px;'>$ext4_02; // 값c 출력</span></p><p><span style='color: rgb(72, 72, 72); line-height: 25.2px; font-family: "돋움", Dotum, sans-serif; font-size: 14px;'> </span></p><p><span style='color: rgb(72, 72, 72); line-height: 25.2px; font-family: "돋움", Dotum, sans-serif; font-size: 14px;'> ~ 이하 생략 ~</span><span style='color: rgb(72, 72, 72); line-height: 25.2px; font-family: "돋움", Dotum, sans-serif; font-size: 14px;'></span></p><p>
로그인 후 평가할 수 있습니다
댓글을 작성하려면 로그인이 필요합니다.
답변을 작성하려면 로그인이 필요합니다.
로그인