채택완료

list.skin.php에서

2017-06-21 (수) 10:36:07 2,573

wr_1안에 

<?

$ex1_filed = explode("|",$list[$i][wr_1]); 

$ext1_00  = $ex1_filed[0];

$ext1_01  = $ex1_filed[1];

$ext1_02  = $ex1_filed[2];

?>

이런식으로 내용이 나눠서 디비에 들어가게 했는데요....

리스트에 $ext1_01 값이 나오게 하려면 어떡해 해야하는거에요?

 

<?php echo $list[$i]['ext1_01'] ?> 이런식으로 출력했더니 아무것도 안나오고... 

 

<?php echo $list[$i]['wr_1'] ?> 로 출력하면 $ext1_00, $ext1_01, $ext1_02 값이 모두나와서요.... 

 

$ext1_01 값만 출력하고 싶으면 어떡해하는지 알려주시면 감사하겠습니다.... 

|

답변 2개

채택된 답변
+20 포인트

list.skin.php 파일에보면

for문이있습니다

for문 아래 explode를 넣으세요

예를들어 이렇게요

Copy
<?php        for ($i=0; $i<count($list); $i++) {			$ex1_filed = explode("|",$list[$i]['wr_1']); 			$ext1_00  = $ex1_filed[0];			$ext1_01  = $ex1_filed[1];			$ext1_02  = $ex1_filed[2];			echo $ext1_00;        ?>
?php echo $list[$i]['wr_1'] ?> 로 출력하면 $ext1_00, $ext1_01, $ext1_02 값이 모두나와서요...
이 부분에.문제의.답이.있는.듯.합니다

출력 결과물이.콤마로 되어 있으니.아래 코드처람.변경.하시면.원하시는 결과가 나올듯 하네요
?
$ex1_filed = explode(",",$list[$i][wr_1]); // 출력물에서 . 콤마로 되어 있습니다
$ext1_00 = $ex1_filed[0];
$ext1_01 = $ex1_filed[1];
$ext1_02 = $ex1_filed[2];
?>

답변을 작성하려면 로그인이 필요합니다.