확장필드 출력 재문의(동일값으로만 출력)
본문
wr_4 필드에 나눠있는 전화번호를 아래와 같이 출력하였는데
리스트 맨 하단 글에 저장되어진 전화번호가 모든리스트에 동일한 전화번호로만 출력됩니다.
각 게시글 마다 전화번호가 각각다르게 입력되어있는데 하나의 전화번호로만 출력되는데,
어디를 수정해야하나요?
<?php
for ($i=0; $i<count($list); $i++) {
$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];
}
?>
<?php echo $ext4_02; ?>-<?php echo $ext4_03; ?>-<?php echo $ext4_04; ?>
답변 1
<?php
for ($i=0; $i<count($list); $i++) {
$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];
?>
<?php echo $ext4_02; ?>-<?php echo $ext4_03; ?>-<?php echo $ext4_04; ?>
<?php } ?>